mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-24 00:29:38 -05:00
Merge pull request #267 from Icinga:feature/add_colon_if_not_set
Fix: Double colon is added, even if check name already contains it
This commit is contained in:
commit
955c2b31f5
1 changed files with 8 additions and 1 deletions
|
|
@ -114,10 +114,17 @@ function New-IcingaCheck()
|
|||
);
|
||||
}
|
||||
|
||||
[bool]$AddColon = $TRUE;
|
||||
|
||||
if ([string]::IsNullOrEmpty($this.Name) -eq $FALSE -And $this.Name[$this.Name.Length - 1] -eq ':') {
|
||||
$AddColon = $FALSE;
|
||||
}
|
||||
|
||||
$this.__CheckOutput = [string]::Format(
|
||||
'{0} {1}: {2}{3}',
|
||||
'{0} {1}{2} {3}{4}',
|
||||
$IcingaEnums.IcingaExitCodeText[$this.__CheckState],
|
||||
$this.Name,
|
||||
(&{ if ($AddColon) { return ':'; } else { return ''; } }),
|
||||
$PluginThresholds,
|
||||
$TimeSpan
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue