forked from lix-project/hydra
Hydra::Helper::Nix: getHydraNotifyPrometheusConfig fixup strict warning around double-declaring cfg
This commit is contained in:
parent
c880888f1e
commit
efd1d78b97
1 changed files with 6 additions and 6 deletions
|
@ -84,20 +84,20 @@ sub getHydraNotifyPrometheusConfig {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $cfg = $cfg->{prometheus};
|
my $promcfg = $cfg->{prometheus};
|
||||||
if (!defined($cfg)) {
|
if (!defined($promcfg)) {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ref $cfg ne "HASH") {
|
if (ref $promcfg ne "HASH") {
|
||||||
print STDERR "Error reading Hydra's configuration file: hydra_notify.prometheus should be a block.\n";
|
print STDERR "Error reading Hydra's configuration file: hydra_notify.prometheus should be a block.\n";
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined($cfg->{"listen_address"}) && defined($cfg->{"port"})) {
|
if (defined($promcfg->{"listen_address"}) && defined($promcfg->{"port"})) {
|
||||||
return {
|
return {
|
||||||
"listen_address" => $cfg->{'listen_address'},
|
"listen_address" => $promcfg->{'listen_address'},
|
||||||
"port" => $cfg->{'port'},
|
"port" => $promcfg->{'port'},
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
print STDERR "Error reading Hydra's configuration file: hydra_notify.prometheus should include listen_address and port.\n";
|
print STDERR "Error reading Hydra's configuration file: hydra_notify.prometheus should include listen_address and port.\n";
|
||||||
|
|
Loading…
Reference in a new issue