From efd1d78b974b6acd34a5a28262d4243ebbac90ed Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 6 Sep 2021 22:03:44 -0400 Subject: [PATCH] Hydra::Helper::Nix: getHydraNotifyPrometheusConfig fixup strict warning around double-declaring cfg --- src/lib/Hydra/Helper/Nix.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/Hydra/Helper/Nix.pm b/src/lib/Hydra/Helper/Nix.pm index 0cb8ac2b..bac90b85 100644 --- a/src/lib/Hydra/Helper/Nix.pm +++ b/src/lib/Hydra/Helper/Nix.pm @@ -84,20 +84,20 @@ sub getHydraNotifyPrometheusConfig { return undef; } - my $cfg = $cfg->{prometheus}; - if (!defined($cfg)) { + my $promcfg = $cfg->{prometheus}; + if (!defined($promcfg)) { 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"; return undef; } - if (defined($cfg->{"listen_address"}) && defined($cfg->{"port"})) { + if (defined($promcfg->{"listen_address"}) && defined($promcfg->{"port"})) { return { - "listen_address" => $cfg->{'listen_address'}, - "port" => $cfg->{'port'}, + "listen_address" => $promcfg->{'listen_address'}, + "port" => $promcfg->{'port'}, }; } else { print STDERR "Error reading Hydra's configuration file: hydra_notify.prometheus should include listen_address and port.\n";