From: Stephen Soltesz Date: Sat, 17 Jan 2009 00:16:08 +0000 (+0000) Subject: Fixes bug when using nodegroups assigned to SliceAttributes: X-Git-Tag: PLCAPI-4.2-15~4 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ea929052c804548268fff6a83f9d80293d3ea2a3;p=plcapi.git Fixes bug when using nodegroups assigned to SliceAttributes: File "/usr/share/plc_api/PLC/Methods/GetSlivers.py", line 219, in call slivers = get_slivers(self.api, slice_ids, node) File "/usr/share/plc_api/PLC/Methods/GetSlivers.py", line 82, in get_slivers if slice_attribute['name'] not in slice_attributes: File "/usr/share/plc_api/PLC/Table.py", line 209, in __eq__ y = self.db_fields(y) File "/usr/share/plc_api/PLC/Table.py", line 198, in db_fields obj.items())) AttributeError: 'unicode' object has no attribute 'items' --- diff --git a/PLC/Methods/GetSlivers.py b/PLC/Methods/GetSlivers.py index e7047a8..3eea2c5 100644 --- a/PLC/Methods/GetSlivers.py +++ b/PLC/Methods/GetSlivers.py @@ -75,11 +75,12 @@ def get_slivers(api, slice_filter, node = None): 'value': sliver_attribute['value']}) # set nodegroup slice attributes + slice_attribute_names = [ slice_attribute['name'] for slice_attribute in slice_attributes ] for slice_attribute in filter(lambda a: a['nodegroup_id'] in node['nodegroup_ids'], slice_attributes): # Do not set any nodegroup slice attributes for # which there is at least one sliver attribute # already set. - if slice_attribute['name'] not in slice_attributes: + if slice_attribute['name'] not in slice_attribute_names: attributes.append({'name': slice_attribute['name'], 'value': slice_attribute['value']})