svn keywords
[plcapi.git] / PLC / Methods / AddSliceTag.py
index 474798e..bca219d 100644 (file)
@@ -1,4 +1,5 @@
 # $Id$
+# $URL$
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
@@ -101,8 +102,10 @@ class AddSliceTag(Method):
                 else:                    
                     node_id = node['node_id']
             
-            if node_id not in slice['node_ids']:
-                raise PLCInvalidArgument, "Node not in the specified slice"
+            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)
             slice_tag['node_id'] = node['node_id']
 
        # Sliver attribute shared accross nodes if nodegroup is sepcified