- api.plshell.DeleteSliceFromNodes(api.plauth, slice['slice'], deleted_nodes)
-
- # TODO: update slice tags
- #network.updateSliceTags()
+ api.plshell.DeleteSliceFromNodes(api.plauth, slice['name'], deleted_nodes)
+ # remove stale attributes
+ for attribute in removed_slice_attributes:
+ try:
+ api.plshell.DeleteSliceTag(api.plauth, attribute['slice_tag_id'])
+ except Exception, e:
+ api.logger.warn('Failed to remove sliver attribute. name: %s, value: %s, node_id: %s\nCause:%s'\
+ % (name, value, node_id, str(e)))
+
+ # add requested_attributes
+ for attribute in requested_slice_attributes:
+ try:
+ name, value, node_id = attribute['name'], attribute['value'], attribute.get('node_id', None)
+ api.plshell.AddSliceTag(api.plauth, slice['name'], name, value, node_id)
+ except Exception, e:
+ api.logger.warn('Failed to add sliver attribute. name: %s, value: %s, node_id: %s\nCause:%s'\
+ % (name, value, node_id, str(e)))