mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-03-01 11:35 pm

[dw-free] Bug in config_generator didn't work if no MogileFS defined, also update path to src/spud/b

[commit: http://hg.dwscoalition.org/dw-free/rev/e5e27214cc19]

Bug in config_generator didn't work if no MogileFS defined, also update path
to src/spud/bin/ which is where it was put this time.

Patch by [staff profile] mark.

Files modified:
  • src/spud/bin/gatherer
  • src/spud/bin/plugins/config_generator.pl
--------------------------------------------------------------------------------
diff -r 6f6d5695a676 -r e5e27214cc19 src/spud/bin/gatherer
--- a/src/spud/bin/gatherer	Sun Mar 01 23:32:50 2009 +0000
+++ b/src/spud/bin/gatherer	Sun Mar 01 23:35:58 2009 +0000
@@ -36,7 +36,7 @@ use Danga::Daemon;
 use Danga::Daemon;
 
 # config
-my $path = "$ENV{LJHOME}/bin/spud";
+my $path = "$ENV{LJHOME}/src/spud/bin";
 my $plugins_path = "$path/plugins";
 
 # command line config
diff -r 6f6d5695a676 -r e5e27214cc19 src/spud/bin/plugins/config_generator.pl
--- a/src/spud/bin/plugins/config_generator.pl	Sun Mar 01 23:32:50 2009 +0000
+++ b/src/spud/bin/plugins/config_generator.pl	Sun Mar 01 23:35:58 2009 +0000
@@ -8,6 +8,7 @@ package ConfigGenPlugin;
 package ConfigGenPlugin;
 
 use strict;
+use MogileFS::Admin;
 
 # called when we're loaded.  here we can do anything necessary to set ourselves
 # up if we want.  in this case we just load the LJ libraries.
@@ -56,14 +57,14 @@ sub helper {
     }
 
     # mogilefsd
-    if ($opts{mogilefsd} && %LJ::MOGILEFS_CONFIG) {
+    if ($opts{mogilefsd} && $LJ::MOGILEFS_CONFIG{hosts}) {
         foreach my $ipaddr (@{$LJ::MOGILEFS_CONFIG{hosts}}) {
             add_job("mogilefsd.$ipaddr", "mogilefsd", [ $ipaddr, @{$opts{mogilefsd}} ], 'config_generator');
         }
     }
 
     # mogstored
-    if ($opts{mogstored} && %LJ::MOGILEFS_CONFIG) {
+    if ($opts{mogstored} && $LJ::MOGILEFS_CONFIG{hosts}) {
         my $mgd = new MogileFS::Admin(hosts => $LJ::MOGILEFS_CONFIG{hosts});
         if ($mgd) {
             my (%hosthash, %devhash);
--------------------------------------------------------------------------------