-
- vat = VatExecutor()
- vat.execute_script_json_out('lisp/show_lisp_eid_table.vat', node)
- return JsonParser().parse_data(vat.get_script_stdout())
+ cmd = u"lisp_eid_table_dump"
+ err_msg = f"Failed to get LISP eid table on host {node[u'host']}"
+
+ with PapiSocketExecutor(node) as papi_exec:
+ details = papi_exec.add(cmd).get_details(err_msg)
+
+ data = list()
+ for eid_details in details:
+ eid = u"Bad eid type"
+ if eid_details[u"eid_type"] == 0:
+ prefix = str(eid_details[u"eid_prefix_len"])
+ eid = str(IPv4Address(eid_details[u"eid"][0:4])) + u"/" + \
+ prefix
+ elif eid_details[u"eid_type"] == 1:
+ prefix = str(eid_details[u"eid_prefix_len"])
+ eid = str(IPv6Address(eid_details[u"eid"])) + u"/" + prefix
+ elif eid_details[u"eid_type"] == 2:
+ eid = str(L2Util.bin_to_mac(eid_details[u"eid"][0:6]))
+ data.append(
+ {
+ u"action": eid_details[u"action"],
+ u"is_local": eid_details[u"is_local"],
+ u"eid": eid,
+ u"vni": eid_details[u"vni"],
+ u"ttl": eid_details[u"ttl"],
+ u"authoritative": eid_details[u"authoritative"]
+ }
+ )
+ return data