system_slice_tags = SliceTags(self.api, {'tagname': 'system', 'value': '1'}).dict('slice_id')
system_slice_ids = system_slice_tags.keys()
if slice['slice_id'] not in system_slice_ids and node_id not in slice['node_ids']:
- raise PLCInvalidArgument, "Node not in the specified slice %s not in %s"%(slice['slice_id'],system_slice_ids)
+ raise PLCInvalidArgument, "AddSliceTag: slice %s not on specified node %s nor is it a system slice (%r)"%(slice['name'],node['hostname'],system_slice_ids)
slice_tag['node_id'] = node['node_id']
# Sliver attribute shared accross nodes if nodegroup is sepcified
'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']: