From: Andy Bavier Date: Tue, 8 Feb 2011 19:33:40 +0000 (-0500) Subject: Fix attribute placement in RSpec X-Git-Tag: sfa-1.0-14~6 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=786198b5b3084d9b5b500a7459dc02826d21a634;p=sfa.git Fix attribute placement in RSpec Fix issue where slice tags assigned to specific nodes were showing up under the tag in the RSpec --- diff --git a/sfa/plc/network.py b/sfa/plc/network.py index dd0b4b4c..ee043814 100644 --- a/sfa/plc/network.py +++ b/sfa/plc/network.py @@ -133,9 +133,12 @@ class Slice: for i in self.slice_tag_ids: try: tag = self.network.lookupSliceTag(i) - if tag.tagname == tagname: - if not (node and node.id != tag.node_id): - tags.append(tag) + if tag.tagname == tagname: + if node: + if node.id == tag.node_id: + tags.append(tag) + elif not tag.node_id: + tags.append(tag) except InvalidRSpec, e: # As they're not needed, we ignore some tag types from # GetSliceTags call. See Slicetag.ignore_tags @@ -150,7 +153,10 @@ class Slice: for i in self.slice_tag_ids: tag = self.network.lookupSliceTag(i) if tag.tagname == tagname: - if (not node) or (node.id == tag.node_id): + if node: + if node.id == tag.node_id: + return tag + elif not tag.node_id: return tag except InvalidRSpec, e: # As they're not needed, we ignore some tag types from