From: Sandrine Avakian Date: Mon, 20 Aug 2012 08:54:37 +0000 (+0200) Subject: Fixed bug when using sfi.py resources. X-Git-Tag: sfa-2.1-24~3^2~97 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=65dbf9c0fb3c7df4cb29ff5d99cf37eea9327d04;p=sfa.git Fixed bug when using sfi.py resources. Now behaves normally and only shows leases when asked to. --- diff --git a/sfa/senslab/slabaggregate.py b/sfa/senslab/slabaggregate.py index a64669b2..2f98c77b 100644 --- a/sfa/senslab/slabaggregate.py +++ b/sfa/senslab/slabaggregate.py @@ -329,7 +329,14 @@ class SlabAggregate: #nodes, links = self.get_nodes(slice, slivers) logger.debug("\r\n \r\n SlabAggregate \tget_rspec ******* slice_xrn %s \r\n \r\n"\ %(slice_xrn)) - if not options.get('list_leases') or options.get('list_leases') and options['list_leases'] != 'leases': + + try: + lease_option = options['list_leases'] + except KeyError: + return + + if lease_option == 'resources': + #if not options.get('list_leases') or options.get('list_leases') and options['list_leases'] != 'leases': nodes = self.get_nodes(slices, slivers) #In case creating a job slice _xrn is not set to None rspec.version.add_nodes(nodes) @@ -356,8 +363,9 @@ class SlabAggregate: rspec.version.add_default_sliver_attribute(attrib['tagname'], \ - attrib['value']) - if options.get('list_leases') or options.get('list_leases') and options['list_leases'] != 'resources': + attrib['value']) + if lease_option in ['all','leases']: + #if options.get('list_leases') or options.get('list_leases') and options['list_leases'] != 'resources': leases = self.get_leases(slices) rspec.version.add_leases(leases)