From: Tony Mack Date: Thu, 7 Jul 2011 17:20:54 +0000 (-0400) Subject: make pg_rspec aware of child tags and X-Git-Tag: sfa-1.0-27~17 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=bc084f519c0e738fc99e8595eab3b8173efd96ac;p=sfa.git make pg_rspec aware of child tags and --- diff --git a/sfa/rspecs/pg_rspec.py b/sfa/rspecs/pg_rspec.py index 2d48e193..e86e13cc 100755 --- a/sfa/rspecs/pg_rspec.py +++ b/sfa/rspecs/pg_rspec.py @@ -112,17 +112,21 @@ class PGRSpec(RSpec): def get_slice_attributes(self, network=None): slice_attributes = [] nodes_with_slivers = self.get_nodes_with_slivers(network) - + from sfa.util.sfalogging import logger # TODO: default sliver attributes in the PG rspec? - + default_ns_prefix = self.namespaces['rspecv2'] for node in nodes_with_slivers: sliver_attributes = self.get_sliver_attributes(node, network) for sliver_attribute in sliver_attributes: name=str(sliver_attribute[0]) value=str(sliver_attribute[1]) # we currently only suppor the and attributes - if name in ['initscript', 'info']: - attribute = {'name': name, 'value': value, 'node_id': node, 'attributes': sliver_attribute[2]} + if 'info' in name: + value = ",".join(["%s=%s" %(a,b) for (a,b) in sliver_attribute[2].items()]) + attribute = {'name': 'flack_info', 'value': value, 'node_id': node} + slice_attributes.append(attribute) + elif 'initscript' in name: + attribute = {'name': 'initscript', 'value': value, 'node_id': node} slice_attributes.append(attribute) return slice_attributes