X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fiotlab%2Fiotlabshell.py;h=ac6009701b27e96d8ae66bd9b8f4de2e43cd6677;hb=65866811e8df57c89f3487db047b5653f306a3c8;hp=f1fb1db0e97e44655751ec6d530aa5d599e68373;hpb=682eb032af3a8c3f6a254183b88e3baf75c1e5f2;p=sfa.git diff --git a/sfa/iotlab/iotlabshell.py b/sfa/iotlab/iotlabshell.py index f1fb1db0..ac600970 100644 --- a/sfa/iotlab/iotlabshell.py +++ b/sfa/iotlab/iotlabshell.py @@ -109,7 +109,7 @@ class IotLABShell(object): def get_reserved_nodes(self): """ - Get all OAR jobs with state Waiting or Running. + Get all OAR jobs not terminated. :Example: {"total":"1907", @@ -128,7 +128,9 @@ class IotLABShell(object): """ logger.warning("iotlashell get_reserved_nodes") reserved_nodes_dict = {} - request = 'admin/experiments?state=Running,Waiting' + request = ('admin/experiments?state=' + 'Running,Waiting,toAckReservation,' + 'toLaunch,Launching') try: experiments = self.api.method(request) except HTTPError as err: @@ -136,11 +138,9 @@ class IotLABShell(object): err.reason) 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 - 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 @@ -159,7 +159,7 @@ class IotLABShell(object): user['email'] = email user['sshPublicKey'] = slice_user['keys'][0] # ex : onelab.inria - user['structure'] = slice_user['slice_record']['authority'] + user['structure'] = slice_user['urn'].split('+')[1].replace(':','.') email = (email.split('@'))[0] user['firstName'] = email.split('.')[0] try: