From 8fcb2b34545d83828b6d588860b6bae0fbc1e58a Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Mon, 22 Feb 2010 18:47:52 +0000 Subject: [PATCH] corner case: permit adding a slice tag/attribute when there exist sliver attributes of the same name --- PLC/Methods/AddSliceTag.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PLC/Methods/AddSliceTag.py b/PLC/Methods/AddSliceTag.py index 284a24f5..b9f51bd8 100644 --- a/PLC/Methods/AddSliceTag.py +++ b/PLC/Methods/AddSliceTag.py @@ -125,6 +125,12 @@ class AddSliceTag(Method): 'tagname': tag_type['tagname'], 'value': value}) for slice_tag_check in slice_tags_check: + # do not compare between slice tag and sliver tag + if 'node_id' not in slice_tag and slice_tag_check['node_id'] is not None: + continue + # do not compare between sliver tag and slice tag + if 'node_id' in slice_tag and slice_tag['node_id'] is not None and slice_tag_check['node_id'] is None: + continue if 'node_id' in slice_tag and slice_tag['node_id'] == slice_tag_check['node_id']: raise PLCInvalidArgument, "Sliver attribute already exists" if 'nodegroup_id' in slice_tag and slice_tag['nodegroup_id'] == slice_tag_check['nodegroup_id']: -- 2.47.0