← Back to team overview

mvhub-dev team mailing list archive

[Merge] lp:~leegoodrich/mvhub/fix_notification_options into lp:mvhub

 

Lee Goodrich has proposed merging lp:~leegoodrich/mvhub/fix_notification_options into lp:mvhub.

Requested reviews:
  mvhub-dev (mvhub-dev)


Modified notification_email.pl to use getopts for setting the config 
file instead of pulling whatever is ARGV[0]. Updated mvhub-cron to 
reflect this change.
-- 
https://code.launchpad.net/~leegoodrich/mvhub/fix_notification_options/+merge/23340
Your team mvhub-dev is subscribed to branch lp:mvhub.
=== modified file 'app-mvhub/bin/notification_email.pl'
--- app-mvhub/bin/notification_email.pl	2010-04-02 18:46:01 +0000
+++ app-mvhub/bin/notification_email.pl	2010-04-13 17:40:40 +0000
@@ -34,7 +34,10 @@
     /;
 
 # Config File Variables
-my $cfg_filename = $ARGV[0] || $ENV{MV_CONFIG_FILE};
+my $cfg_filename = $ENV{MV_CONFIG_FILE};
+	Getopt::Long::GetOptions( 'config=s' => \$cfg_filename )
+        or die "GetOptions failed";
+        
 my $CFG = MVHub::Utils::ConfigSimple::create_config_from($cfg_filename);
 
 my $MAX_NOTIFICATIONS = $CFG->param('NOTIFICATION.max_notifications');
@@ -60,7 +63,7 @@
     my $execute = 0;
     Getopt::Long::GetOptions( 'execute' => \$execute )
         or die "GetOptions failed";
-
+        
     my @date = Date::Calc::Add_Delta_YM( Date::Calc::Today(), 0,
         -($EXPIRE_MONTHS) );
     my $expire_date = join '-', @date;

=== modified file 'app-mvhub/setup/etc/cron.d/mvhub-cron'
--- app-mvhub/setup/etc/cron.d/mvhub-cron	2010-03-31 15:20:38 +0000
+++ app-mvhub/setup/etc/cron.d/mvhub-cron	2010-04-13 17:40:40 +0000
@@ -19,4 +19,5 @@
     10    0    *             *     *           www-data   $BIN_DIR//generate_agency_program_pdf.pl $CONF_DIR/$MVH_CONF_FILE
     15    0    *             *     *           www-data   $BIN_DIR//generate_agency_program_pdf.pl $CONF_DIR/$NSP_CONF_FILE
 
-    51    8    1,15          *     *           www-data   $BIN_DIR/notification_email.pl --execute
+    51    8    1,15          *     *           www-data   $BIN_DIR/notification_email.pl --config=$CONF_DIR/$MVH_CONF_FILE --execute
+    51    8    1,15          *     *           www-data   $BIN_DIR/notification_email.pl --config=$CONF_DIR/$NSP_CONF_FILE --execute


Follow ups