diff options
author | Greg Sabino Mullane | 2013-09-23 19:44:38 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2013-09-23 19:44:38 +0000 |
commit | f9d17961a54d3867bd9e6253e4b2aef5f0ab566b (patch) | |
tree | 72777ecdae907cc00084c872d4111d85360aead0 | |
parent | 63689d1bfa670420045e0551a783a58bd6f82ed6 (diff) |
Perl::Critic insipred fixes
-rwxr-xr-x | check_postgres.pl | 13 | ||||
-rw-r--r-- | t/02_disk_space.t | 2 | ||||
-rw-r--r-- | t/02_last_vacuum.t | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/check_postgres.pl b/check_postgres.pl index d231c8e39..548a85ae3 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -2263,7 +2263,7 @@ sub run_command { $ENV{PGSERVICE} = $db->{dbservice}; } else { - $db->{pname} = "port=" . ($db->{port} || $opt{defaultport}) . " host=$db->{host} db=$db->{dbname} user=$db->{dbuser}"; + $db->{pname} = 'port=' . ($db->{port} || $opt{defaultport}) . " host=$db->{host} db=$db->{dbname} user=$db->{dbuser}"; } ## If all we want is a connection string, give it and leave now @@ -4751,7 +4751,7 @@ sub check_hot_standby_delay { # Check if master is online (e.g. really a master) for my $x (1..2) { - my $info = run_command($SQL, { dbnumber => $x, regex => qr(t|f) }); + my $info = run_command($SQL, { dbnumber => $x, regex => qr([tf]) }); for $db (@{$info->{db}}) { my $status = $db->{slurp}[0]; @@ -5550,18 +5550,19 @@ sub check_pgagent_jobs { next; } - my ($is_crit, @msg); + my ($is_critical, @msg); my $log_id = -1; for my $step (@rows) { my $output = $step->{jsloutput} || '(NO OUTPUT)'; push @msg => "$step->{jslresult} $step->{jobname}/$step->{jstname}: $output"; - $is_crit ||= $step->{critical}; + $is_critical ||= $step->{critical}; } (my $msg = join '; ' => @msg) =~ s{\r?\n}{ }g; - if ($is_crit) { + if ($is_critical) { add_critical $msg; - } else { + } + else { add_warning $msg; } } diff --git a/t/02_disk_space.t b/t/02_disk_space.t index 7226a627d..74e3a6eeb 100644 --- a/t/02_disk_space.t +++ b/t/02_disk_space.t @@ -12,7 +12,7 @@ use CP_Testing; # df might fail in chroot environments, e.g. on build daemons where # check-postgres packages are built -system "df > /dev/null 2>&1"; +system q{df > /dev/null 2>&1}; if ($?) { plan skip_all => 'Skipping disk_space tests because df does not work'; } else { diff --git a/t/02_last_vacuum.t b/t/02_last_vacuum.t index 2df8b61dd..806c07a0a 100644 --- a/t/02_last_vacuum.t +++ b/t/02_last_vacuum.t @@ -61,7 +61,7 @@ $t = qq{$S exclude rules work}; $cp->drop_table_if_exists($testtbl); $dbh->do(qq{CREATE TABLE $testtbl AS SELECT 123::INTEGER AS a FROM generate_series(1,200000)}); $dbh->commit(); -like ($cp->run("-w 0 --exclude=~.*"), +like ($cp->run(q{-w 0 --exclude=~.*}), qr{No matching tables found due to exclusion}, $t); $t = qq{$S sees a recent VACUUM}; |