Commit 20076c41 authored by douomo's avatar douomo
Browse files

fix check on QoS

parent d0b85acd
Loading
Loading
Loading
Loading
+170 B (6.91 KiB)

File changed.

No diff preview for this file type.

+5 −4
Original line number Diff line number Diff line
@@ -29,12 +29,13 @@ def get_iface_metrics(m, int_name, metric):
    cfg = m.get(filter=("subtree", xml)).data_xml
    BuiltIn().log_to_console(cfg)
    tree = ET.fromstring(cfg)
    value = tree.findall(".//ns1:"+metric, namespaces={"ns0" :"urn:ietf:params:xml:ns:netconf:base:1.0","ns1": "urn:ietf:params:xml:ns:yang:ietf-microwave-radio-link"})
    if len(value)>0:
    iface = tree.findall(".//ns0:"+"interface", namespaces={'ns0': 'urn:ietf:params:xml:ns:yang:ietf-interfaces','ns1': 'urn:ietf:params:xml:ns:yang:ietf-microwave-radio-link'})
    if len(iface)>0:
        BuiltIn().log_to_console("Found iface")
        return value[0].text
        metric = iface[0].findall(".//ns1:"+metric, namespaces={'ns0': 'urn:ietf:params:xml:ns:yang:ietf-interfaces','ns1': 'urn:ietf:params:xml:ns:yang:ietf-microwave-radio-link'})
        return metric[0].text
    else:
        return None
        return "No iface found"
    

def connect_with_key(host, port, username, key_file):
+23 −969

File changed.

Preview size limit exceeded, changes collapsed.