Skip to content

Commit

Permalink
Subject: Fix bad syslog levels, fix bad quoting, consistently ignore …
Browse files Browse the repository at this point in the history
…svn internal files

From: Phil Dibowitz <phil@ipom.com>

Trac: Refs #127, #128

- Various places are trying to log with 'warn' which isn't valid
  and causes spine to crash instead of log the warning
- While I was in various files fixing logging, I fixed " -> ' in a few
  places.
- We ignore .svn for config keys, but not overlays. My ignoring voer
  overlays is not as agressive on overlays as config keys because
  that would break stuff, I just want to be able to do --croot
  with my checkout directory without dropping .svn dirs everywhere.

From: Phil Dibowitz <phil@ipom.com>
  • Loading branch information
pdibowitz committed Mar 16, 2011
1 parent 7a752df commit eb81120
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions lib/Spine/Plugin/Overlay.pm
Expand Up @@ -197,6 +197,12 @@ sub apply_overlay
chomp $srcfile; # most likely redundant
my $destfile = $srcfile;

if ($srcfile =~ /\.svn/)
{
$c->error("Skipping $srcfile due to lame filename", "warning");
next;
}

if ($srcfile !~ m!^$tmpdir!)
{
$srcfile = $tmpdir . $srcfile;
Expand Down
2 changes: 1 addition & 1 deletion lib/Spine/Plugin/SystemInfo.pm
Expand Up @@ -94,7 +94,7 @@ sub get_sysinfo
} else {
$c->error('the "c_netcard" key will be "unknown" as '.
'no "network_device_map" key has been defined',
'warn');
'warning');
}


Expand Down
14 changes: 7 additions & 7 deletions lib/Spine/Registry.pm
Expand Up @@ -523,9 +523,9 @@ sub run_hooks_until {
# first argument passed to hooks
my $c = $_[0];
unless ($c->isa('Spine::Data')) {
$self->error("Spine::Data must be passed when running hooks");
$self->error('Spine::Data must be passed when running hooks');
# attempt to make sure that the caller will bail out if this happens
return ([ "CORE", PLUGIN_FATAL, undef ], PLUGIN_FATAL, 1);
return ([ 'CORE', PLUGIN_FATAL, undef ], PLUGIN_FATAL, 1);
}

my $errors = 0;
Expand All @@ -545,20 +545,20 @@ sub run_hooks_until {
push @results, [ $hook->{name}, $rc , $hook];

if (($rc & PLUGIN_FATAL) == PLUGIN_FATAL) {
$c->error("FATAL error while running hook ".
$c->error('FATAL error while running hook '.
"\"$hook->{module}::$hook->{name}\" ".
"for \"$self->{name}\"", "crit");
"for \"$self->{name}\"", 'crit');
$fatal++;
}
elsif ($rc & PLUGIN_ERROR) {
$c->error("ERROR while running hook ".
$c->error('ERROR while running hook '.
"\"$hook->{module}::$hook->{name}\" for ".
"\"$self->{name}\"", "warn");
"\"$self->{name}\"", 'warning');
$errors++;
}

if ($until & $rc) {
$self->debug(3, "UNTIL condition met while ".
$self->debug(3, 'UNTIL condition met while '.
"running hook for \"$self->{name}\"");
last;
}
Expand Down

0 comments on commit eb81120

Please sign in to comment.