From: Tony Mack Date: Wed, 1 Apr 2009 15:11:07 +0000 (+0000) Subject: fix bug in get_rspec when trying to get the rspec for a slice that doesnt exist X-Git-Tag: sfa-0.9-0@14641~534 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=bd2afb5e4dceedea1ed52ca000a534e659d32dd6;hp=50c936038cf4185334d19bf023ce52974a09154f;p=sfa.git fix bug in get_rspec when trying to get the rspec for a slice that doesnt exist --- diff --git a/geni/aggregate.py b/geni/aggregate.py index b94e572f..4b9f8a3a 100644 --- a/geni/aggregate.py +++ b/geni/aggregate.py @@ -263,8 +263,12 @@ class Aggregate(GeniServer): elif type in ['slice']: slicename = hrn_to_pl_slicename(hrn) slices = self.shell.GetSlices(self.auth, [slicename]) - node_ids = slices[0]['node_ids'] - nodes = self.shell.GetNodes(self.auth, node_ids) + if not slices: + nodes = [] + else: + slice = slices[0] + node_ids = slice['node_ids'] + nodes = self.shell.GetNodes(self.auth, node_ids) # Filter out whitelisted nodes public_nodes = lambda n: n.has_key('slice_ids_whitelist') and not n['slice_ids_whitelist']