mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
Fixed check initialising for AddCheck() on Check Packages
This commit is contained in:
parent
a7c51ef59b
commit
891a93a1d4
1 changed files with 16 additions and 3 deletions
|
|
@ -30,12 +30,20 @@ function New-IcingaCheckPackage()
|
||||||
|
|
||||||
$Check | Add-Member -membertype ScriptMethod -name 'Initialise' -value {
|
$Check | Add-Member -membertype ScriptMethod -name 'Initialise' -value {
|
||||||
foreach ($check in $this.checks) {
|
foreach ($check in $this.checks) {
|
||||||
$check.verbose = $this.verbose;
|
$this.InitCheck($check);
|
||||||
$check.AddSpacing();
|
|
||||||
$check.SilentCompile();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$Check | Add-Member -membertype ScriptMethod -name 'InitCheck' -value {
|
||||||
|
if ($null -eq $check) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$check.verbose = $this.verbose;
|
||||||
|
$check.AddSpacing();
|
||||||
|
$check.SilentCompile();
|
||||||
|
}
|
||||||
|
|
||||||
$Check | Add-Member -membertype ScriptMethod -name 'AddSpacing' -value {
|
$Check | Add-Member -membertype ScriptMethod -name 'AddSpacing' -value {
|
||||||
$this.spacing += 1;
|
$this.spacing += 1;
|
||||||
foreach ($check in $this.checks) {
|
foreach ($check in $this.checks) {
|
||||||
|
|
@ -47,6 +55,11 @@ function New-IcingaCheckPackage()
|
||||||
$Check | Add-Member -membertype ScriptMethod -name 'AddCheck' -value {
|
$Check | Add-Member -membertype ScriptMethod -name 'AddCheck' -value {
|
||||||
param($check);
|
param($check);
|
||||||
|
|
||||||
|
if ($null -eq $check) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this.InitCheck($check);
|
||||||
$this.checks += $check;
|
$this.checks += $check;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue