[LON-CAPA-cvs] cvs: loncom /automation Autocreate.pl

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Thu, 07 Feb 2008 04:39:42 -0000


raeburn		Wed Feb  6 23:39:42 2008 EDT

  Modified files:              
    /loncom/automation	Autocreate.pl 
  Log:
  - Result and logmsg from &LONCAPA::batchcreatecourse::create_courses() printed to logfile.
  - : separated list of escaped (courseIDs:classID) entries printed to STDOUT. 
  
  
Index: loncom/automation/Autocreate.pl
diff -u loncom/automation/Autocreate.pl:1.7 loncom/automation/Autocreate.pl:1.8
--- loncom/automation/Autocreate.pl:1.7	Mon Sep  3 11:34:16 2007
+++ loncom/automation/Autocreate.pl	Wed Feb  6 23:39:42 2008
@@ -101,16 +101,18 @@
 
     print $fh "Sending to batch - auto,$defdom,$dcname,$dcdom ".join(":",@requests)."\n";
     my ($result,$logmsg) = &LONCAPA::batchcreatecourse::create_courses(\@requests,\%courseids,'auto',$defdom,$dcname,$dcdom);
-    my $output;
+    my $outcome;
     if ($result ne '') {
-        $output = $result."\n";
+        $outcome = $result."\n";
     }
     if ($logmsg ne '') {
-        $output .= $logmsg."\n";    
+        $outcome .= $logmsg."\n";    
     }
+    print $fh $outcome;
 
+    my $output;
 # Copy requests from pending directory to processed directory and unlink.
-  foreach my $request (@requests) {  
+    foreach my $request (@requests) {  
         if ((-e "$batchdir/pending/$request") && $request !~ /\.\./ && $request ne '' &&$request ne './') {
             open(FILE,"<$batchdir/pending/$request");
             my @buffer = <FILE>;