# add nodes from rspec
added_nodes = list(set(requested_slivers).difference(current_slivers))
+ # get sliver attributes
+ slice_attributes = rspec.get_slice_attributes()
+
try:
if peer:
api.plshell.UnBindObjectFromPeer(api.plauth, 'slice', slice['slice_id'], peer)
api.plshell.AddSliceToNodes(api.plauth, slice['name'], added_nodes)
api.plshell.DeleteSliceFromNodes(api.plauth, slice['name'], deleted_nodes)
-
- # TODO: update slice tags
- #network.updateSliceTags()
+ for attribute in sliver_atrributes:
+ name, value, node_id = attribute['tagname'], attribute['value'], attribute.get('node_id', None)
+ api.plshell.AddSliceTag(api.plauth, slice['name'], name, value, node_id)
finally:
if peer:
def get_nodes_without_slivers(self, network=None):
pass
+
+ def get_slice_attributes(self, network=None):
+ pass
+
+ def get_default_sliver_attributes(self, network=None):
+ pass
def add_nodes(self, nodes, check_for_dupes=False):
if not isinstance(nodes, list):
sliver = node.find("sliver")
return self.attributes_list(sliver)
+ def get_slice_attributes(self, network=None):
+ # TODO: FINISH
+ return []
+
def get_site_nodes(self, siteid, network=None):
if network:
nodes = self.xml.xpath('//network[@name="%s"]/site[@id="%s"]/node/hostname/text()' % \