From 786198b5b3084d9b5b500a7459dc02826d21a634 Mon Sep 17 00:00:00 2001 From: Andy Bavier Date: Tue, 8 Feb 2011 14:33:40 -0500 Subject: [PATCH] Fix attribute placement in RSpec Fix issue where slice tags assigned to specific nodes were showing up under the tag in the RSpec --- sfa/plc/network.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 -- 2.43.0