gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r25732 - in gnunet-planetlab/gplmt: . contrib/tasklists


From: gnunet
Subject: [GNUnet-SVN] r25732 - in gnunet-planetlab/gplmt: . contrib/tasklists
Date: Wed, 9 Jan 2013 14:06:31 +0100

Author: wachs
Date: 2013-01-09 14:06:31 +0100 (Wed, 09 Jan 2013)
New Revision: 25732

Modified:
   gnunet-planetlab/gplmt/contrib/tasklists/check_node.xml
   gnunet-planetlab/gplmt/gplmt.py
Log:
fixes


Modified: gnunet-planetlab/gplmt/contrib/tasklists/check_node.xml
===================================================================
--- gnunet-planetlab/gplmt/contrib/tasklists/check_node.xml     2013-01-09 
13:03:09 UTC (rev 25731)
+++ gnunet-planetlab/gplmt/contrib/tasklists/check_node.xml     2013-01-09 
13:06:31 UTC (rev 25732)
@@ -10,14 +10,6 @@
         <expected_output>2013</expected_output>
         <stop_on_fail>true</stop_on_fail>
        </run> 
-    <run id="21" name="Install dependencies with yum : libidn-devel">
-          <command>sudo yum -y -t --nogpgcheck install</command> 
-          <arguments>libidn-devel</arguments> 
-          <timeout>0</timeout> 
-          <expected_return_code>0</expected_return_code>
-          <expected_output></expected_output>
-          <stop_on_fail>false</stop_on_fail>
-    </run>
-               </sequence>     
+    </sequence>        
 </tasklist>
 

Modified: gnunet-planetlab/gplmt/gplmt.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt.py     2013-01-09 13:03:09 UTC (rev 25731)
+++ gnunet-planetlab/gplmt/gplmt.py     2013-01-09 13:06:31 UTC (rev 25732)
@@ -57,11 +57,19 @@
 
 def main():
     global main
+    tasks_file = None
+    single_host = None
+    nodes_file = None
+    pl_password = None
+    config_file = None    
+    pl_use_nodes = False
+    verbose = False
+    startid = -1
+
     try:
         main = Main ()
         
     # Init
-        main.pl_password = None
         
     # Check dependencies 
         if (False == elementtree_loaded):
@@ -77,43 +85,43 @@
     # Parse command line arguments
         
         try:
-            opts, args = getopt.getopt(sys.argv[1:], "hvc:n:t:ap:s:H:", 
["help", "config=", "nodes=", "tasks=", "all", "password", "startid", "host"])
+            opts, args = getopt.getopt(sys.argv[1:], "hvVc:n:t:ap:s:H:", 
["help", "verbose", "config=", "nodes=", "tasks=", "all", "password", 
"startid", "host"])
         except getopt.GetoptError, err:
             # print help information and exit:
             print str(err) # will print something like "option -a not 
recognized"
             usage()
             sys.exit(2)
         for o, a in opts:
-            if o == "-v":
-                main.verbose = True
+            if o in ("-V", "--verbose"):
+                verbose = True
             elif o in ("-h", "--help"):
                 usage()
                 sys.exit()
             elif o in ("-c", "--config"):
-                main.config_file = Util.handle_filename(a)
+                config_file = Util.handle_filename(a)
             elif o in ("-H", "--host"):
-                main.single_host = a                     
+                single_host = a                     
             elif o in ("-n", "--nodes"):
-                main.nodes_file = Util.handle_filename(a)
+                nodes_file = Util.handle_filename(a)
             elif o in ("-t", "--tasks"):
-                main.tasks_file = Util.handle_filename(a)
+                tasks_file = Util.handle_filename(a)
             elif o in ("-a", "--all"):
-                main.pl_use_nodes = True
+                pl_use_nodes = True
             elif o in ("-p", "--password"):
-                main.pl_password = a
+                pl_password = a
             elif o in ("-s", "--startid"):
-                main.startid = a                                        
+                startid = a                                        
             else:
                 assert False, "unhandled option"
     
-        if (main.verbose == True):
+        if (verbose == True):
             main.logger = Util.Logger (True)
         else:
             main.logger = Util.Logger (False)
             
-        if (main.config_file != ""):                            
+        if (config_file != None):                            
             # Load configuration file
-            configuration = Configuration.Configuration (main.config_file, 
main.logger);
+            configuration = Configuration.Configuration (config_file, 
main.logger);
             if (configuration.load() == False):
                 print "Failed to load configuration..."
                 sys.exit(2)
@@ -125,21 +133,19 @@
                 sys.exit(2)
                 
         # Update configuration
-        if (True == main.pl_use_nodes):
+        if (True == pl_use_nodes):
             configuration.pl_use_nodes = True        
-        if (None != main.pl_password):
-            print main.pl_password
-            configuration.pl_password = main.pl_password
-        if ("" != main.tasks_file):
-            configuration.taskfile = main.tasks_file
+        if (None != pl_password):
+            configuration.pl_password = pl_password
+        if (None != tasks_file):
+            configuration.taskfile = tasks_file      
         
-        
         # command line beats configuration
-        if ((main.nodes_file == "") and 
-           (configuration.pl_use_nodes == False) and 
-           (main.single_host == None)):
+        if ((nodes_file == "") and 
+               (configuration.pl_use_nodes == False) and 
+               (single_host == None)):
             if (configuration.nodesfile != ""):
-                main.nodes_file = configuration.nodesfile
+                nodes_file = configuration.nodesfile
             else: 
                 print "No nodes file given!\n"
                 usage()
@@ -148,6 +154,7 @@
             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:"            
@@ -155,16 +162,16 @@
                 configuration.pl_password = configuration.pl_password.strip()  
     
        # Load hosts files
-        if (main.single_host != None):
-            nodes = Nodes.StringNodes (main.single_host, main.logger)
+        if (single_host != None):
+            nodes = Nodes.StringNodes (single_host, main.logger)
             if (nodes.load() == False):
                 sys.exit(5)         
-        elif ((configuration.pl_use_nodes == True) or 
(configuration.pl_use_nodes == True)):
+        elif (configuration.pl_use_nodes == True):
             nodes = Nodes.PlanetLabNodes (configuration, main.logger)
             if (nodes.load() == False):
                 sys.exit(6)        
-        elif (main.nodes_file != ""):
-            nodes = Nodes.Nodes (main.nodes_file, main.logger);
+        elif (configuration.nodesfile != ""):
+            nodes = Nodes.Nodes (configuration.nodesfile, main.logger);
             if (nodes.load() == False):
                 sys.exit(7)
         else:
@@ -172,7 +179,7 @@
             sys.exit(8)        
     
        # Load actions file
-        tasks = Tasks.Tasks (main.tasks_file, main.logger, main.startid);
+        tasks = Tasks.Tasks (configuration.taskfile, main.logger, startid);
         if (tasks.load() == False):
             sys.exit(2)        
     
@@ -216,15 +223,7 @@
 General help using GNU software: http://www.gnu.org/gethelp/";
 
 class Main:
-    verbose = False;
-    config_file = "";
-    nodes_file = "";
-    tasks_file = "";
-    pl_password = "";
-    pl_use_nodes = False;
     logger = None;
-    startid = -1;
-    single_host = None;
     def __init__(self):
         self.verbose = False;
         




reply via email to

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