X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fiotlab%2Fiotlabshell.py;h=f237dded88dedbb1cb9bd725dc8879d1b8c0b3d9;hb=3e6097e2d50ff322b45f53fcb22d07fc16adbdb6;hp=ac6009701b27e96d8ae66bd9b8f4de2e43cd6677;hpb=2880f8a4ec7acc3925cb865ce6b3076dd593274a;p=sfa.git diff --git a/sfa/iotlab/iotlabshell.py b/sfa/iotlab/iotlabshell.py index ac600970..f237dded 100644 --- a/sfa/iotlab/iotlabshell.py +++ b/sfa/iotlab/iotlabshell.py @@ -52,7 +52,7 @@ class IotLABShell(object): nodes_dict[node['network_address']] = node return nodes_dict - def get_users(self): + def get_users(self, email=None): """ Get all LDAP users :returns: users with LDAP attributes @@ -79,7 +79,10 @@ class IotLABShell(object): logger.warning("iotlashell get_users") users_dict = {} try: - users = self.api.method('admin/users') + if email: + users = self.api.method('admin/users?email=%s' % email) + else: + users = self.api.method('admin/users') except HTTPError as err: logger.warning("iotlashell get_users error %s" % err.reason) return {'error': err.reason} @@ -94,6 +97,7 @@ class IotLABShell(object): """ # pylint:disable=W0212,R0913,E1123 logger.warning("iotlashell reserve_nodes") + logger.info("login=%s, exp_name=%s, nodes_list=%s, start_time=%s, duration=%s" % (login, exp_name, nodes_list, start_time, duration)) exp_file = helpers.FilesDict() _experiment = experiment._Experiment(exp_name, duration, start_time) _experiment.type = 'physical' @@ -150,11 +154,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]