mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Fix Self-Service API key input prompt during install wizard, even if key is set
Fixes #52
This commit is contained in:
parent
66eda2d71b
commit
a040873e31
1 changed files with 5 additions and 2 deletions
|
|
@ -33,13 +33,16 @@ function Start-IcingaAgentDirectorWizard()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ForceTemplateKey -eq $FALSE) {
|
if ($ForceTemplateKey -eq $FALSE) {
|
||||||
$SelfServiceAPIKey = $LocalAPIKey;
|
if ([string]::IsNullOrEmpty($LocalAPIKey)) {
|
||||||
if ([string]::IsNullOrEmpty($SelfServiceAPIKey)) {
|
|
||||||
$LegacyTokenPath = Join-Path -Path Get-IcingaAgentConfigDirectory -ChildPath 'icingadirector.token';
|
$LegacyTokenPath = Join-Path -Path Get-IcingaAgentConfigDirectory -ChildPath 'icingadirector.token';
|
||||||
if (Test-Path $LegacyTokenPath) {
|
if (Test-Path $LegacyTokenPath) {
|
||||||
$SelfServiceAPIKey = Get-Content -Path $LegacyTokenPath;
|
$SelfServiceAPIKey = Get-Content -Path $LegacyTokenPath;
|
||||||
Set-IcingaPowerShellConfig -Path 'IcingaDirector.SelfService.ApiKey' -Value $SelfServiceAPIKey;
|
Set-IcingaPowerShellConfig -Path 'IcingaDirector.SelfService.ApiKey' -Value $SelfServiceAPIKey;
|
||||||
|
} else {
|
||||||
|
$ForceTemplateKey = $TRUE;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$SelfServiceAPIKey = $LocalAPIKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue