add ASAP mgt and fix start_time with ASAP jobs
fsaintma [Mon, 8 Jun 2015 08:41:11 +0000 (10:41 +0200)]
sfa/iotlab/iotlabaggregate.py
sfa/iotlab/iotlabdriver.py
sfa/iotlab/iotlabshell.py

index 2b49615..ee95299 100644 (file)
@@ -187,8 +187,6 @@ class IotLABAggregate(object):
                 leases.append(reserved_nodes[lease_id])
 
             rspec_leases = self.leases_to_rspec_leases(leases)
-            logger.warning("iotlabaggregate list_resources rspec_leases  %s" %
-                           rspec_leases)
             rspec.version.add_leases(rspec_leases)
         return rspec.toxml()
 
index 8a52ee6..231ed06 100644 (file)
@@ -63,7 +63,6 @@ class IotLabDriver(Driver):
         return geni_slivers
 
     def aggregate_version(self):
-        logger.warning("iotlabdriver aggregate_version")
         version_manager = VersionManager()
         ad_rspec_versions = []
         request_rspec_versions = []
@@ -145,6 +144,9 @@ class IotLabDriver(Driver):
         leases = rspec.version.get_leases()
         start_time = min([int(lease['start_time'])
                          for lease in leases])
+        # ASAP Jobs
+        if start_time == 0:
+            start_time = None
         end_time = max([int(lease['start_time']) +
                        int(lease['duration'])*60
                        for lease in leases])
index f1fb1db..becdbf5 100644 (file)
@@ -137,10 +137,13 @@ class IotLABShell(object):
             return {'error': err.reason}
         for exp in experiments['items']:
             # BUG IN OAR REST API : job with reservation didn't return
-            # resources attribute list
-            # we use another request for finding job resources
+            # resources attribute list. We use another request for
+            # finding job resources
             exp_nodes = self.api.method('admin/experiments/%d' % exp['id'])
             exp['resources'] = exp_nodes['nodes']
+            # BUG ASAP jobs without date information
+            if exp['date'] == "as soon as possible":
+                exp['date'] = 0
             reserved_nodes_dict[exp['id']] = exp
         return reserved_nodes_dict