Permalink
Browse files

Subject: Fix bad syslog levels, fix bad quoting, consistently ignore …

…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...
1 parent 7a752df commit eb8112058e9e7ee7776161542be992bf1aa4b07d pdibowitz committed Mar 16, 2011
Showing with 14 additions and 8 deletions.
  1. +6 −0 lib/Spine/Plugin/Overlay.pm
  2. +1 −1 lib/Spine/Plugin/SystemInfo.pm
  3. +7 −7 lib/Spine/Registry.pm
@@ -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;
@@ -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');
}
View
@@ -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;
@@ -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;
}

0 comments on commit eb81120

Please sign in to comment.