from sfa.rspecs.elements.element import Element
from sfa.rspecs.elements.node import Node
from sfa.rspecs.elements.sliver import Sliver
-from sfa.rspecs.elements.network import Network
from sfa.rspecs.elements.location import Location
from sfa.rspecs.elements.hardware_type import HardwareType
from sfa.rspecs.elements.disk_image import DiskImage
if 'authority_id' in node and node['authority_id']:
node_elem.set('site_id', node['authority_id'])
- location_elems = Element.add_elements(node_elem, 'location', node.get('location', []), Location.fields)
- interface_elems = Element.add_elements(node_elem, 'interface', node.get('interfaces', []), Interface.fields)
+ location_elems = Element.add_elements(node_elem, 'location',
+ node.get('location', []), Location.fields)
+ interface_elems = Element.add_elements(node_elem, 'interface',
+ node.get('interfaces', []), Interface.fields)
#if 'bw_unallocated' in node and node['bw_unallocated']:
# bw_unallocated = etree.SubElement(node_elem, 'bw_unallocated', units='kbps').text = str(int(node['bw_unallocated'])/1000)
@staticmethod
def get_nodes_with_slivers(xml):
- xpath = '//node/sliver | //default:node/default:sliver' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))
+ xpath = '//node/sliver | //default:node/default:sliver'
node_elems = xml.xpath(xpath)
- return SFAv1Node.get_nodes_objs(node_elems)
+ return SFAv1Node.get_node_objs(node_elems)
@staticmethod
node['interfaces'] = Element.get_elements(node_elem, './default:interface | ./interface', Interface)
node['services'] = PGv2Services.get_services(node_elem)
node['slivers'] = SFAv1Sliver.get_slivers(node_elem)
- node['tags'] = SFAv1PLTag.get_pl_tags(node_elem, ignore=Node.fields.keys())
+#thierry node['tags'] = SFAv1PLTag.get_pl_tags(node_elem, ignore=Node.fields.keys())
+ node['tags'] = SFAv1PLTag.get_pl_tags(node_elem, ignore=Node.fields)
nodes.append(node)
return nodes