Merge pull request #659 from Icinga:fix/icinga_plain_config_writer_publishes_invalid_configuration

Fix: Config writer publishing invalid Icinga plain config
This commit is contained in:
Lord Hepipud 2023-08-07 20:05:38 +02:00 committed by GitHub
commit 093c5e7935
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -7,6 +7,14 @@ documentation before upgrading to a new release.
Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed).
## 1.11.1 (tbd)
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/29)
### Bugfixes
* [#659](https://github.com/Icinga/icinga-powershell-framework/pull/659) Fixes configuration writer which publishes invalid Icinga plain configuration files
## 1.11.0 (2023-08-01)
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/26)

View file

@ -666,7 +666,11 @@ function Write-IcingaPlainConfigurationFiles()
$AddNewLine = $FALSE;
}
[string]$Value = $CheckCommand.vars[$var];
$IcingaConfig += [string]::Format(' vars.{0} = {1}{2}', $var, $Value.ToLower(), (New-IcingaNewLine));
if ($CheckCommand.vars[$var] -Is [bool]) {
$IcingaConfig += [string]::Format(' vars.{0} = {1}{2}', $var, $Value.ToLower(), (New-IcingaNewLine));
} else {
$IcingaConfig += [string]::Format(' vars.{0} = "{1}"{2}', $var, $Value.ToLower(), (New-IcingaNewLine));
}
}
}
} else {