FIT IoT-Lab requires organization of new users: generate one from the urn
authorLoic Baron <loic.baron@lip6.fr>
Tue, 6 Feb 2018 16:25:10 +0000 (17:25 +0100)
committerLoic Baron <loic.baron@lip6.fr>
Tue, 6 Feb 2018 16:25:10 +0000 (17:25 +0100)
sfa/iotlab/iotlabshell.py

index ac60097..101de84 100644 (file)
@@ -150,11 +150,17 @@ class IotLABShell(object):
         """
         # pylint:disable=E1123
         logger.warning("iotlashell add_user")
+        logger.warning("slice_user: %s" % slice_user)
+        if 'urn' in slice_user:
+            organization = slice_user['urn']
+        else:
+            organization = "SFA federation"
         # single account creation
         user = {"type": "SA",
                 "city": "To be defined",
                 "country": "To be defined",
-                "motivations": "SFA federation"}
+                "motivations": "SFA federation",
+                "organization": organization}
         email = slice_user['email']
         user['email'] = email
         user['sshPublicKey'] = slice_user['keys'][0]