git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
23726f8
)
Last changes to fix the returned Rspec with leases that should not
author
Sandrine Avakian
<sandrine.avakian@inria.fr>
Wed, 11 Sep 2013 14:27:47 +0000
(16:27 +0200)
committer
Mohamed Larabi
<mohamed.larabi@inria.fr>
Mon, 16 Sep 2013 13:58:56 +0000
(15:58 +0200)
be there problem.
sfa/iotlab/iotlabaggregate.py
patch
|
blob
|
history
diff --git
a/sfa/iotlab/iotlabaggregate.py
b/sfa/iotlab/iotlabaggregate.py
index
9831973
..
584a9c2
100644
(file)
--- a/
sfa/iotlab/iotlabaggregate.py
+++ b/
sfa/iotlab/iotlabaggregate.py
@@
-286,7
+286,7
@@
class IotlabAggregate:
('lease_id', 'hostname', 'site_id', 'name', 'start_time', 'duration').
All the leases running or scheduled are returned.
('lease_id', 'hostname', 'site_id', 'name', 'start_time', 'duration').
All the leases running or scheduled are returned.
- :param ldap_username: if
a
ldap uid is not None, looks for the leases
+ :param ldap_username: if ldap uid is not None, looks for the leases
belonging to this user.
:type ldap_username: string
:returns: rspec lease dictionary with keys lease_id, component_id,
belonging to this user.
:type ldap_username: string
:returns: rspec lease dictionary with keys lease_id, component_id,
@@
-310,7
+310,7
@@
class IotlabAggregate:
logger.debug("IOTLABAGGREGATE get_all_leases ldap_username %s "
% (ldap_username))
logger.debug("IOTLABAGGREGATE get_all_leases ldap_username %s "
% (ldap_username))
- leases = self.driver.iotlab_api.GetLeases(ldap_username)
+ leases = self.driver.iotlab_api.GetLeases(l
ogin=l
dap_username)
grain = self.driver.iotlab_api.GetLeaseGranularity()
# site_ids = []
rspec_leases = []
grain = self.driver.iotlab_api.GetLeaseGranularity()
# site_ids = []
rspec_leases = []
@@
-357,7
+357,7
@@
class IotlabAggregate:
:type options: dict
:returns: Xml Rspec.
:type options: dict
:returns: Xml Rspec.
- :rtype: XML
f
+ :rtype: XML
"""
"""
@@
-379,6
+379,16
@@
class IotlabAggregate:
version.type, version.version, 'manifest')
slices, slivers = self.get_slice_and_slivers(slice_xrn, login)
version.type, version.version, 'manifest')
slices, slivers = self.get_slice_and_slivers(slice_xrn, login)
+ if slice_xrn and slices is not None:
+ #Get user associated with this slice
+ #for one_slice in slices :
+ ldap_username = slices[0]['reg_researchers'][0].__dict__['hrn']
+ # ldap_username = slices[0]['user']
+ tmp = ldap_username.split('.')
+ ldap_username = tmp[1]
+ logger.debug("IotlabAggregate \tget_rspec **** \
+ LDAP USERNAME %s \r\n" \
+ % (ldap_username))
#at this point sliver may be empty if no iotlab job
#is running for this user/slice.
rspec = RSpec(version=rspec_version, user_options=options)
#at this point sliver may be empty if no iotlab job
#is running for this user/slice.
rspec = RSpec(version=rspec_version, user_options=options)
@@
-409,12
+419,14
@@
class IotlabAggregate:
#In case creating a job, slice_xrn is not set to None
rspec.version.add_nodes(nodes)
if slice_xrn and slices is not None:
#In case creating a job, slice_xrn is not set to None
rspec.version.add_nodes(nodes)
if slice_xrn and slices is not None:
- #Get user associated with this slice
- #for one_slice in slices :
- # ldap_username = slices[0]['hrn']
- # tmp = ldap_username.split('.')
- # ldap_username = tmp[1].split('_')[0]
- ldap_username = slices[0]['user']
+ # #Get user associated with this slice
+ # #for one_slice in slices :
+ # ldap_username = slices[0]['reg_researchers']
+ # # ldap_username = slices[0]['user']
+ # tmp = ldap_username.split('.')
+ # ldap_username = tmp[1]
+ # # ldap_username = tmp[1].split('_')[0]
+
logger.debug("IotlabAggregate \tget_rspec **** \
version type %s ldap_ user %s \r\n" \
% (version.type, ldap_username))
logger.debug("IotlabAggregate \tget_rspec **** \
version type %s ldap_ user %s \r\n" \
% (version.type, ldap_username))