Ejemplo n.º 1
0
 def _xml_to_py(self, has_xml, has_py):
     # common to all subclasses
     Resource._r_has_xml_status(has_xml, has_py)
     has_py["admin"] = bool(has_xml.find("disable") is None)
     Resource.copyifexists(has_xml, "description", has_py)
     Resource.copyifexists(has_xml, "mtu", has_py)
     has_py["$unit_count"] = len(has_xml.findall("unit"))
Ejemplo n.º 2
0
 def _xml_to_py(self, has_xml, has_py):
     # common to all subclasses
     Resource._r_has_xml_status(has_xml, has_py)
     has_py['admin'] = bool(has_xml.find('disable') is None)
     Resource.copyifexists(has_xml, 'description', has_py)
     Resource.copyifexists(has_xml, 'mtu', has_py)
     has_py['$unit_count'] = len(has_xml.findall('unit'))
Ejemplo n.º 3
0
 def _xml_to_py(self, has_xml, has_py):
     # common to all subclasses
     Resource._r_has_xml_status(has_xml, has_py)
     has_py['admin'] = bool(has_xml.find('disable') is None)
     Resource.copyifexists(has_xml, 'description', has_py)
     Resource.copyifexists(has_xml, 'mtu', has_py)
     has_py['$unit_count'] = len(has_xml.findall('unit'))
Ejemplo n.º 4
0
    def _xml_to_py(self, has_xml, has_py):
        PhyPortBase._xml_to_py(self, has_xml, has_py)

        Resource.copyifexists(has_xml, 'speed', has_py)
        Resource.copyifexists(has_xml, 'link-mode', has_py, 'duplex')
        if has_xml.find('gigether-options/loopback') is not None:
            has_py['loopback'] = True
        has_py['$unit_count'] = len(has_xml.findall('unit'))

        # normalizers
        if 'duplex' in has_py:
            PhyPortBase._set_invert(has_py, 'duplex', self.PORT_DUPLEX)
Ejemplo n.º 5
0
    def _xml_to_py(self, has_xml, has_py):
        PhyPortBase._xml_to_py(self, has_xml, has_py)

        Resource.copyifexists(has_xml, "speed", has_py)
        Resource.copyifexists(has_xml, "link-mode", has_py, "duplex")
        if has_xml.find("gigether-options/loopback") is not None:
            has_py["loopback"] = True
        has_py["$unit_count"] = len(has_xml.findall("unit"))

        # normalizers
        if "duplex" in has_py:
            PhyPortBase._set_invert(has_py, "duplex", self.PORT_DUPLEX)