- if 'bw_unallocated' in node:
- pass
- if 'bw_limit' in node:
- pass
-
-
- def add_slivers(self, hostnames, network=None, no_dupes=False):
- if not isinstance(hostnames, list):
- hostnames = [hostnames]
+ if 'interfaces' in node:
+ for interface in node['interfaces']:
+ if 'bwlimit' in interface and interface['bwlimit']:
+ bwlimit = etree.SubElement(node_tag, 'bw_limit', units='kbps').text = str(interface['bwlimit']/1000)
+ if 'tags' in node:
+ for tag in node['tags']:
+ # expose this hard wired list of tags, plus the ones that are marked 'sfa' in their category
+ if tag['tagname'] in ['fcdistro', 'arch'] or 'sfa' in tag['category'].split('/'):
+ tag_element = etree.SubElement(node_tag, tag['tagname'], value=tag['value'])
+
+ if 'site' in node:
+ longitude = str(node['site']['longitude'])
+ latitude = str(node['site']['latitude'])
+ location = etree.SubElement(node_tag, 'location', country='unknown', \
+ longitude=longitude, latitude=latitude)
+
+ def add_interfaces(self, interfaces):
+ pass
+
+ def add_links(self, links):
+ pass
+
+ def add_slivers(self, slivers, network=None, no_dupes=False):
+ if not isinstance(slivers, list):
+ slivers = [slivers]