ispman/bin ispman-agent,1.69,1.70

Joerg Delker <[email protected]>
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv12325/bin

Modified Files:
	ispman-agent 
Log Message:
fixed [ 1544512 ] WEB UI/ Agent should check ispman.createMailbox exit codes?
improved overall error handling
improved logging

Index: ispman-agent
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman-agent,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- ispman-agent	9 Oct 2005 09:27:54 -0000	1.69
+++ ispman-agent	7 Sep 2006 20:56:53 -0000	1.70
@@ -259,14 +259,19 @@
 sub executeCommands{
     $NOEXEC=0;
     my @commands=@_;
+    my $errs=0;
     foreach $command(@commands) {
-        if ($VERBOSE) {
-            print "Command: $command\n";
-        }
+        my $rc=-1;
+        
         unless ($NOEXEC){
-            system($command);
+            $rc=system($command);
         }
+        logsay("Command=\"$command\", rc=".$rc);
+
+        $errs+=($rc!=0);
+
     }
+    return $errs;
 }
 
 
@@ -311,14 +316,15 @@
        print $text;
     }
     if ($retVal==0) {
-       return 0;
+       return $text;
+    }
+    
+    my $errs = executeCommands(@cmd);
+    if ($errs==0) { 
+      return 1;
     } else {
-       executeCommands(@cmd);
-       return 1;
+        return "There were $errs errors on\n".join("\n",@cmd);
     }
-
-
-
 }
 
 sub DESTROY {


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.