From e7bd75bcf1c7532b0d6d47c9de2211670a835721 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Wed, 29 Jun 2011 20:18:23 -0400 Subject: [PATCH] CreateSliver now handles slice attributes --- sfa/managers/aggregate_manager_pl.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sfa/managers/aggregate_manager_pl.py b/sfa/managers/aggregate_manager_pl.py index a2449b2d..1c1ea161 100644 --- a/sfa/managers/aggregate_manager_pl.py +++ b/sfa/managers/aggregate_manager_pl.py @@ -196,7 +196,7 @@ def CreateSliver(api, slice_xrn, creds, rspec_string, users, call_id): added_nodes = list(set(requested_slivers).difference(current_slivers)) # get sliver attributes - slice_attributes = rspec.get_sliver_attributes() + slice_attributes = rspec.get_slice_attributes() try: if peer: @@ -205,8 +205,13 @@ def CreateSliver(api, slice_xrn, creds, rspec_string, users, call_id): api.plshell.AddSliceToNodes(api.plauth, slice['name'], added_nodes) api.plshell.DeleteSliceFromNodes(api.plauth, slice['name'], deleted_nodes) 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) + 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('Unable to add sliver attribute name: %s, value: %s, node_id: %s' \ + % (name, value, node_id)) + api.logger.warn(str(e)) finally: if peer: -- 2.43.0