aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/LispUtil.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2016-08-24 16:09:20 +0200
committerTibor Frank <tifrank@cisco.com>2016-09-05 14:02:48 +0200
commitc3bf9f6ad20223998c1103ba3061a5e338979e2b (patch)
treeeb8aca3374dc12f708d6fe9fcfd9f70eab6d1a3c /resources/libraries/python/LispUtil.py
parent752104dfc1b8453367f0d6740f628b702c07e0b5 (diff)
CSIT-229: ip4-lispgpe-ip4
- main fib, - vrf, - phy2lisp Change-Id: Ic9bacef4574dc07b25041c4cd0653825a65c94fb Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/libraries/python/LispUtil.py')
-rw-r--r--resources/libraries/python/LispUtil.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/resources/libraries/python/LispUtil.py b/resources/libraries/python/LispUtil.py
index 8a83dc4d30..c50e626b80 100644
--- a/resources/libraries/python/LispUtil.py
+++ b/resources/libraries/python/LispUtil.py
@@ -15,7 +15,7 @@
from resources.libraries.python.parsers.JsonParser import JsonParser
from resources.libraries.python.topology import Topology
-from resources.libraries.python.VatExecutor import VatExecutor
+from resources.libraries.python.VatExecutor import VatExecutor, VatTerminal
class LispUtil(object):
@@ -40,18 +40,25 @@ class LispUtil(object):
return JsonParser().parse_data(vat.get_script_stdout())
@staticmethod
- def vpp_show_lisp_locator_set(node):
+ def vpp_show_lisp_locator_set(node, items_filter):
"""Get lisp locator_set from VPP node.
:param node: VPP node.
+ :param items_filter: Filter which specifies which items should be
+ retrieved - local, remote, empty string = both.
:type node: dict
+ :type items_filter: str
:return: Lisp locator_set data as python list.
:rtype: list
"""
- vat = VatExecutor()
- vat.execute_script_json_out('lisp/show_lisp_locator_set.vat', node)
- return JsonParser().parse_data(vat.get_script_stdout())
+ try:
+ with VatTerminal(node) as vat:
+ response = vat.vat_terminal_exec_cmd_from_template(
+ 'lisp/show_lisp_locator_set.vat', filter=items_filter)
+ return response[0]
+ except ValueError:
+ return []
@staticmethod
def vpp_show_lisp_eid_table(node):