mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2026-02-03 04:09:29 -05:00
Fixes Update-Icinga to print an error in case a component is not installed
This commit is contained in:
parent
1fba01e7a2
commit
9c69c351a8
2 changed files with 8 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
|||
|
||||
### Bugfixes
|
||||
|
||||
* [#729](https://github.com/Icinga/icinga-powershell-framework/issues/729) Fixes `Update-Icinga` to print an error in case a component is not installed, instead of silently continue
|
||||
* [#734](https://github.com/Icinga/icinga-powershell-framework/issues/734) Fixes a scenario on which a JEA service could become orphaned while manually stopping the Icinga for Windows service, without gracefully shutting down JEA
|
||||
|
||||
### Enhancements
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ function Update-Icinga()
|
|||
$CurrentInstallation = Get-IcingaInstallation -Release:$Release -Snapshot:$Snapshot;
|
||||
[bool]$UpdateJEA = $FALSE;
|
||||
[array]$ComponentsList = @();
|
||||
[bool]$IsInstalled = $FALSE;
|
||||
|
||||
# We need to make sure that the framework is always installed first as component
|
||||
# to prevent possible race-conditions during update, in case we update plugins
|
||||
|
|
@ -44,6 +45,8 @@ function Update-Icinga()
|
|||
continue;
|
||||
}
|
||||
|
||||
$IsInstalled = $TRUE;
|
||||
|
||||
$NewVersion = $Component.LatestVersion;
|
||||
|
||||
if ([string]::IsNullOrEmpty($Version) -eq $FALSE) {
|
||||
|
|
@ -76,6 +79,10 @@ function Update-Icinga()
|
|||
Install-IcingaComponent -Name $entry -Version $NewVersion -Release:$Release -Snapshot:$Snapshot -Confirm:$Confirm -Force:$Force -KeepRepoErrors;
|
||||
}
|
||||
|
||||
if ($IsInstalled -eq $FALSE) {
|
||||
Write-IcingaConsoleError 'Failed to update the component "{0}", as it is not installed' -Objects $Name;
|
||||
}
|
||||
|
||||
# Update JEA profile if JEA is enabled once the update is complete
|
||||
if ([string]::IsNullOrEmpty((Get-IcingaJEAContext)) -eq $FALSE -And $UpdateJEA) {
|
||||
Update-IcingaJEAProfile;
|
||||
|
|
|
|||
Loading…
Reference in a new issue