From: Saint-Marcel Frederic <frederic.saint-marcel@inria.fr>
Date: Fri, 17 Jan 2014 15:14:17 +0000 (+0100)
Subject: bugfix Iot-LAB driver geni-v3 allocate with FireXP
X-Git-Tag: sfa-3.1-2~11
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a18309fad3730753e850b2993784bcc53b89c9c6;p=sfa.git

bugfix Iot-LAB driver geni-v3 allocate with FireXP
---

diff --git a/sfa/iotlab/iotlabdriver.py b/sfa/iotlab/iotlabdriver.py
index 1f571155..9c27275e 100644
--- a/sfa/iotlab/iotlabdriver.py
+++ b/sfa/iotlab/iotlabdriver.py
@@ -1430,6 +1430,12 @@ class IotlabDriver(Driver):
         sfa_users = options.get('sfa_users', [])
         if sfa_users:
             slice_record = sfa_users[0].get('slice_record', [])
+            slice_record['user'] = {'keys': users[0]['keys'],
+                                    'email': users[0]['email'],
+                                    'hrn': slice_record['reg-researchers'][0]}
+
+        logger.debug("IOTLABDRIVER.PY \t urn %s allocate options  %s "
+                     % (urn, options))
 
         # parse rspec
         rspec = RSpec(rspec_string)
diff --git a/sfa/iotlab/iotlabslices.py b/sfa/iotlab/iotlabslices.py
index c441d65b..91d89ed2 100644
--- a/sfa/iotlab/iotlabslices.py
+++ b/sfa/iotlab/iotlabslices.py
@@ -456,20 +456,20 @@ class IotlabSlices:
                                 ldap_reslt %s " % (users, ldap_reslt))
 
         requested_user_emails = users_by_email.keys()
-        requested_user_hrns = \
-            [users_by_email[user]['hrn'] for user in users_by_email]
-        logger.debug("IOTLABSLICES.PY \tverify_person  \
-                       users_by_email  %s " % (users_by_email))
+        # requested_user_hrns = \
+        #     [users_by_email[user]['hrn'] for user in users_by_email]
+        # logger.debug("IOTLABSLICES.PY \tverify_person  \
+        #                users_by_email  %s " % (users_by_email))
 
-        #Check that the user of the slice in the slice record
-        #matches one of the existing users
-        try:
-            if slice_record['reg-researchers'][0] in requested_user_hrns:
-                logger.debug(" IOTLABSLICES  \tverify_person ['PI']\
-                                slice_record %s" % (slice_record))
+        # #Check that the user of the slice in the slice record
+        # #matches one of the existing users
+        # try:
+        #     if slice_record['reg-researchers'][0] in requested_user_hrns:
+        #         logger.debug(" IOTLABSLICES  \tverify_person ['PI']\
+        #                         slice_record %s" % (slice_record))
 
-        except KeyError:
-            pass
+        # except KeyError:
+        #     pass
 
         # users to be added, removed or updated
         #One user in one iotlab slice : there should be no need
@@ -507,7 +507,7 @@ class IotlabSlices:
             person['email'] = added_user['email']
             person['key_ids'] = added_user.get('key_ids', [])
 
-            ret = self.driver.testbed_shell.AddPerson(person)
+            ret = self.driver.AddPerson(person)
             if 'uid' in ret:
                 # meaning bool is True and the AddPerson was successful
                 person['uid'] = ret['uid']