Merge pull request #343 from Icinga:fix/freeze_on_imc_missing_cmd

Fix: Freeze on IMC in case commands are not found

Fixes a freeze within Icinga Management Console, in case commands which previously existed were removed/renamed or the user applied an invalid configuration with unknown commands as install file or install command
This commit is contained in:
Lord Hepipud 2021-08-19 17:47:02 +02:00 committed by GitHub
commit 23c138be48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -21,6 +21,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
* [#330](https://github.com/Icinga/icinga-powershell-framework/pull/330) Fixes `Remove-ItemSecure` which was not using all args and might fail on empty path entries * [#330](https://github.com/Icinga/icinga-powershell-framework/pull/330) Fixes `Remove-ItemSecure` which was not using all args and might fail on empty path entries
* [#332](https://github.com/Icinga/icinga-powershell-framework/pull/332) Fixes Icinga Director Self-Service ticket handling, which was not working within the Icinga Management Console * [#332](https://github.com/Icinga/icinga-powershell-framework/pull/332) Fixes Icinga Director Self-Service ticket handling, which was not working within the Icinga Management Console
* [#335](https://github.com/Icinga/icinga-powershell-framework/pull/335) Fixes Icinga Director Self-Service Zones and CA config for legacy installation wizard * [#335](https://github.com/Icinga/icinga-powershell-framework/pull/335) Fixes Icinga Director Self-Service Zones and CA config for legacy installation wizard
* [#343](https://github.com/Icinga/icinga-powershell-framework/pull/343) Fixes freeze within Icinga Management Console, in case commands which previously existed were removed/renamed or the user applied an invalid configuration with unknown commands as install file or install command
### Enhancements ### Enhancements

View file

@ -65,7 +65,13 @@ function Show-IcingaForWindowsInstallerConfigurationSummary()
if (Test-Numeric ($ConfigEntry.Selection)) { if (Test-Numeric ($ConfigEntry.Selection)) {
Set-IcingaForWindowsInstallationHeaderSelection -Selection $ConfigEntry.Selection; Set-IcingaForWindowsInstallationHeaderSelection -Selection $ConfigEntry.Selection;
&$RealCommand; try {
&$RealCommand;
} catch {
$ErrMsg = [string]::Format('Failed to apply configuration item "{0}". This could happen in case elements were removed or renamed between Framework versions: {1}', $RealCommand, $_.Exception.Message);
$global:Icinga.InstallWizard.LastError += $ErrMsg;
continue;
}
$Caption = ([string]::Format('{0}=> {1}', $PrintName, $global:Icinga.InstallWizard.HeaderPreview)); $Caption = ([string]::Format('{0}=> {1}', $PrintName, $global:Icinga.InstallWizard.HeaderPreview));
} else { } else {
@ -85,6 +91,8 @@ function Show-IcingaForWindowsInstallerConfigurationSummary()
$CurrentIndex += 1; $CurrentIndex += 1;
} }
Write-Host 'Finished'
Disable-IcingaForWindowsInstallationHeaderPrint; Disable-IcingaForWindowsInstallationHeaderPrint;
Enable-IcingaForWindowsInstallationJumpToSummary; Enable-IcingaForWindowsInstallationJumpToSummary;