1 from sfa.util.sfalogging import logger
2 from sfa.util.xml import XpathFilter
3 from sfa.util.xrn import Xrn, get_leaf
5 from sfa.rspecs.elements.element import Element
6 from sfa.rspecs.elements.link import Link
12 def get_links(xml, filter=None):
15 xpath = '//link%s | //openflow:link%s' % (
16 XpathFilter.xpath(filter), XpathFilter.xpath(filter))
17 link_elems = xml.xpath(xpath)
18 return Ofeliav1Link.get_link_objs(link_elems)
21 def get_link_objs(link_elems):
23 for link_elem in link_elems:
24 link = Link(link_elem.attrib, link_elem)