Merge pull request #363 from Icinga:fix/jea_pid_empty_no_continue

Fix: Unneeded continue on no JEA pid present

In case no JEA pid is present, we should not lookup any processes and simply return `False` instead.
This commit is contained in:
Lord Hepipud 2021-09-09 15:23:23 +02:00 committed by GitHub
commit d36a0976bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -15,6 +15,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
* [#361](https://github.com/Icinga/icinga-powershell-framework/issues/361) Fixes IMC freeze on Icinga Director Self-Service installation, in case no Agent installation set on Self-Service API config * [#361](https://github.com/Icinga/icinga-powershell-framework/issues/361) Fixes IMC freeze on Icinga Director Self-Service installation, in case no Agent installation set on Self-Service API config
* [#362](https://github.com/Icinga/icinga-powershell-framework/issues/362) Fixes repository component installation from file share locations * [#362](https://github.com/Icinga/icinga-powershell-framework/issues/362) Fixes repository component installation from file share locations
* [#363](https://github.com/Icinga/icinga-powershell-framework/issues/363) Fixes unneeded continue for JEA process lookup, in case no JEA pid is present
## 1.6.0 (2021-09-07) ## 1.6.0 (2021-09-07)

View file

@ -8,6 +8,10 @@ function Test-IcingaJEAServiceRunning()
[string]$JeaPid = Get-IcingaJEAServicePid; [string]$JeaPid = Get-IcingaJEAServicePid;
} }
if ([string]::IsNullOrEmpty($JeaPid)) {
return $FALSE;
}
$JeaPowerShellProcess = Get-Process -Id $JeaPid -ErrorAction SilentlyContinue; $JeaPowerShellProcess = Get-Process -Id $JeaPid -ErrorAction SilentlyContinue;
if ($null -eq $JeaPowerShellProcess) { if ($null -eq $JeaPowerShellProcess) {
return $FALSE; return $FALSE;