gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r25733 - in gnunet-planetlab/gplmt: . gplmt


From: gnunet
Subject: [GNUnet-SVN] r25733 - in gnunet-planetlab/gplmt: . gplmt
Date: Wed, 9 Jan 2013 14:20:00 +0100

Author: wachs
Date: 2013-01-09 14:20:00 +0100 (Wed, 09 Jan 2013)
New Revision: 25733

Modified:
   gnunet-planetlab/gplmt/gplmt.py
   gnunet-planetlab/gplmt/gplmt/Worker.py
Log:
fix

Modified: gnunet-planetlab/gplmt/gplmt/Worker.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt/Worker.py      2013-01-09 13:06:31 UTC (rev 
25732)
+++ gnunet-planetlab/gplmt/gplmt/Worker.py      2013-01-09 13:20:00 UTC (rev 
25733)
@@ -135,7 +135,7 @@
             channel.exec_command(task.command + " " + task.arguments)
             
         except SSHException as e:
-            print self.node + " : Error while trying to connect: " + str(e)
+            g_logger.log (self.node + " : Error while trying to connect: " + 
str(e))
         
         if (task.timeout > 0):
             timeout = task.timeout
@@ -290,7 +290,7 @@
                 paramiko.BadHostKeyException, 
                 paramiko.AuthenticationException,
                 socket.error) as e:  
-            print self.node + " : Error while trying to connect: " + str(e)
+            g_logger.log (self.node + " : Error while trying to connect: " + 
str(e))
             g_notifications.node_connected (self.node, False)
             g_notifications.tasklist_completed (self.node, self.tasks, False)
             return

Modified: gnunet-planetlab/gplmt/gplmt.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt.py     2013-01-09 13:06:31 UTC (rev 25732)
+++ gnunet-planetlab/gplmt/gplmt.py     2013-01-09 13:20:00 UTC (rev 25733)
@@ -138,42 +138,37 @@
         if (None != pl_password):
             configuration.pl_password = pl_password
         if (None != tasks_file):
-            configuration.taskfile = tasks_file      
+            configuration.taskfile = tasks_file
+        if (None != nodes_file):
+            configuration.nodesfile = nodes_file                        
         
-        # command line beats configuration
-        if ((nodes_file == "") and 
-               (configuration.pl_use_nodes == False) and 
-               (single_host == None)):
-            if (configuration.nodesfile != ""):
-                nodes_file = configuration.nodesfile
-            else: 
-                print "No nodes file given!\n"
-                usage()
-                sys.exit(3)
-        if (configuration.taskfile  == ""):
-            print "No tasks file given!\n"
-            usage()
-            sys.exit(4)
-        
         if ((True == configuration.pl_use_nodes) and 
(configuration.pl_password == None)):
             while ((configuration.pl_password == None) or 
(configuration.pl_password == "")):
                 print "Please enter PlanetLab password:"            
                 configuration.pl_password = getpass.getpass()
                 configuration.pl_password = configuration.pl_password.strip()  
     
-       # Load hosts files
+       # Load hosts files: single host, nodes files, planetlab
+                # command line beats configuration
+        if ((None == single_host) and 
+            ("" == configuration.nodesfile) and
+            (False == configuration.pl_use_nodes)):
+            print "No nodes to use given!\n"
+            usage()
+            sys.exit(4)
+        
         if (single_host != None):
             nodes = Nodes.StringNodes (single_host, main.logger)
             if (nodes.load() == False):
-                sys.exit(5)         
+                sys.exit(5)        
+        elif (configuration.nodesfile != ""):
+            nodes = Nodes.Nodes (configuration.nodesfile, main.logger);
+            if (nodes.load() == False):
+                sys.exit(7)                 
         elif (configuration.pl_use_nodes == True):
             nodes = Nodes.PlanetLabNodes (configuration, main.logger)
             if (nodes.load() == False):
                 sys.exit(6)        
-        elif (configuration.nodesfile != ""):
-            nodes = Nodes.Nodes (configuration.nodesfile, main.logger);
-            if (nodes.load() == False):
-                sys.exit(7)
         else:
             print "No nodes file given!\n" 
             sys.exit(8)        




reply via email to

[Prev in Thread] Current Thread [Next in Thread]