Esempio n. 1
0
 def get_elements(self, element_type, filter={}):
     """
     search for a registered element
     """
     if element_type not in self.elements:
         msg = "Unable to search for element %s in rspec, expath expression not found." % \
                element_type
         raise InvalidRSpecElement(element_type, extra=msg)
     rspec_element = self.get_rspec_element(element_type)
     xpath = rspec_element.path + XpathFilter.xpath(filter)
     return self.xml.xpath(xpath)
Esempio n. 2
0
 def get_elements(self, element_type, filter={}):
     """
     search for a registered element
     """
     if element_type not in self.elements:
         msg = "Unable to search for element %s in rspec, expath expression not found." % \
                element_type
         raise InvalidRSpecElement(element_type, extra=msg)
     rspec_element = self.get_rspec_element(element_type)
     xpath = rspec_element.path + XpathFilter.xpath(filter)
     return self.xml.xpath(xpath)
Esempio n. 3
0
 def get_leases(xml, filter={}):
     xpath = '//lease%s | //default:lease%s' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))
     lease_elems = xml.xpath(xpath)
     return SFAv1Lease.get_lease_objs(lease_elems)
Esempio n. 4
0
 def get_nodes(xml, filter={}):
     xpath = '//node%s | //default:node%s' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))
     node_elems = xml.xpath(xpath)
     return PGv2Node.get_node_objs(node_elems)
Esempio n. 5
0
 def get_leases(xml, filter={}):
     xpath = '//lease%s | //default:lease%s' % (XpathFilter.xpath(filter),
                                                XpathFilter.xpath(filter))
     lease_elems = xml.xpath(xpath)
     return SFAv1Lease.get_lease_objs(lease_elems)
Esempio n. 6
0
 def get_nodes(xml, filter={}):
     xpath = '//node%s | //default:node%s' % (XpathFilter.xpath(filter),
                                              XpathFilter.xpath(filter))
     node_elems = xml.xpath(xpath)
     return NITOSv1Node.get_node_objs(node_elems)
Esempio n. 7
0
 def get_channels(xml, filter={}):
     xpath = '//channel%s | //default:channel%s' % (
         XpathFilter.xpath(filter), XpathFilter.xpath(filter))
     channel_elems = xml.xpath(xpath)
     return NITOSv1Channel.get_channel_objs(channel_elems)
Esempio n. 8
0
 def get_channels(xml, filter={}):
     xpath = '//channel%s | //default:channel%s' % (XpathFilter.xpath(filter), XpathFilter.xpath(filter))
     channel_elems = xml.xpath(xpath)
     return NITOSv1Channel.get_channel_objs(channel_elems)