Fixing small mistake in GetLeases.
[sfa.git] / sfa / iotlab / iotlabslices.py
index fb04525..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))
 
@@ -130,6 +130,9 @@ class IotlabSlices:
 
         #First remove job whose duration is too short
         for job in requested_jobs_dict.values():
+            job['duration'] = \
+                str(int(job['duration']) \
+                * self.driver.iotlab_api.GetLeaseGranularity())
             if job['duration'] < self.driver.iotlab_api.GetLeaseGranularity():
                 del requested_jobs_dict[job['start_time']]
 
@@ -350,7 +353,7 @@ class IotlabSlices:
 
         Checking that a user exist is based on the user's email. If the user is
         still not found in the LDAP, it means that the user comes from another
-        federated. In this case an account has to be created in LDAP
+        federated testbed. In this case an account has to be created in LDAP
         so as to enable the user to use the testbed, since we trust the testbed
         he comes from. This is done by calling AddPerson.