-#!/usr/bin/python
+
import datetime
import time
# add nodes from rspec
added_nodes = list(set(requested_slivers).difference(current_slivers))
+ # get sliver attributes
+ slice_attributes = rspec.get_sliver_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 slice_attributes:
+ 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:
api.plshell.BindObjectToPeer(api.plauth, 'slice', slice.id, peer,
slice.peer_id)
- return aggregate.get_rspec(slice_xrn=slice_xrn, version=rspec.version, type='advertisement')
+ return aggregate.get_rspec(slice_xrn=slice_xrn, version=rspec.version)
def RenewSliver(api, xrn, creds, expiration_time, call_id):
#panos adding the info option to the caching key (can be improved)
if options.get('info'):
- version_string = version_string + "_"+options.get('info')
+ version_string = version_string + "_"+options.get('info', 'default')
- print "[aggregate] version string = ",version_string
-
# look in cache first
if caching and api.cache and not xrn:
rspec = api.cache.get(version_string)