Merge branch 'master' of ssh://git.onelab.eu/git/sfa
authorMohamed Larabi <mohamed.larabi@inria.fr>
Thu, 10 Oct 2013 10:02:28 +0000 (12:02 +0200)
committerMohamed Larabi <mohamed.larabi@inria.fr>
Thu, 10 Oct 2013 10:02:28 +0000 (12:02 +0200)
sfa/client/sfi.py
sfa/iotlab/iotlabaggregate.py
sfa/iotlab/iotlabslices.py

index 133bd00..4888132 100644 (file)
@@ -477,6 +477,8 @@ use this if you mean an authority instead""")
                              metavar="slice_hrn", help="delegate cred. for slice HRN")
             parser.add_option("-a", "--auths", dest='delegate_auths',action='append',default=[],
                              metavar='auth_hrn', help="delegate PI cred for auth HRN")
+            parser.add_option('-d', '--delegate', dest='delegate', help="Override 'delegate' from the config file")
+            parser.add_option('-b', '--backend',  dest='backend',  help="Override 'backend' from the config file")
         
         return parser
 
@@ -1522,8 +1524,14 @@ $ sfi m
         myslice_dict={}
         myslice_keys=['backend', 'delegate', 'platform', 'username']
         for key in myslice_keys:
-            full_key="MYSLICE_" + key.upper()
-            value=getattr(self.config_instance,full_key,None)
+            value=None
+            # oct 2013 - I'm finding myself juggling with config files
+            # so I'm adding a few command-line options to override config
+            if hasattr(args,key):
+                value=getattr(args,key)
+            else:
+                full_key="MYSLICE_" + key.upper()
+                value=getattr(self.config_instance,full_key,None)
             if value:   myslice_dict[key]=value
             else:       print "Unsufficient config, missing key %s in [myslice] section of sfi_config"%key
         if len(myslice_dict) != len(myslice_keys):
index 4ea6a81..483c3a1 100644 (file)
@@ -340,7 +340,7 @@ class IotlabAggregate:
                     pass
                 rspec_lease['start_time'] = lease['t_from']
                 rspec_lease['duration'] = (lease['t_until'] - lease['t_from']) \
-                    # * grain
+                     / grain
                 rspec_leases.append(rspec_lease)
         return rspec_leases
 
index 34a380c..991b35d 100644 (file)
@@ -108,7 +108,7 @@ class IotlabSlices:
         logger.debug("IOTLABSLICES verify_slice_leases sfa_slice %s "
                      % (sfa_slice))
         #First get the list of current leases from OAR
-        leases = self.driver.iotlab_api.GetLeases({'name': sfa_slice['hrn']})
+        leases = self.driver.iotlab_api.GetLeases({'slice_hrn': sfa_slice['hrn']})
         logger.debug("IOTLABSLICES verify_slice_leases requested_jobs_dict %s \
                         leases %s " % (requested_jobs_dict, leases))