Commit fee47bfd authored by douomo's avatar douomo
Browse files

add check on port status before checkin params

parent 0b0121f4
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -256,6 +256,8 @@ def check_LLDP_inventory(xml_reply):
        actual_params = actual_params + 2 
        actual_params = actual_params + 2 
        portID = port.findall(".//ns1:port-id", namespaces={"ns1": "urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp"})
        portID = port.findall(".//ns1:port-id", namespaces={"ns1": "urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp"})
        portIDSubtype = port.findall(".//ns1:port-id-subtype", namespaces={"ns1": "urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp"})
        portIDSubtype = port.findall(".//ns1:port-id-subtype", namespaces={"ns1": "urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp"})
        adminstatus = port.findall(".//ns1:admin-status", namespaces={"ns1": "urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp"}) #HW
        if adminstatus[0].text != "disabled": #HW
            if len(portID)==0 or len(portIDSubtype)==0:
            if len(portID)==0 or len(portIDSubtype)==0:
                actual_params = actual_params -2+ len(portID) + len(portIDSubtype)
                actual_params = actual_params -2+ len(portID) + len(portIDSubtype)
            #return "port data incomplete"
            #return "port data incomplete"