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