diff --git a/scripts/scale/control-node/cn_introspect_bgp.py b/scripts/scale/control-node/cn_introspect_bgp.py index 473436d6c..3a673e424 100755 --- a/scripts/scale/control-node/cn_introspect_bgp.py +++ b/scripts/scale/control-node/cn_introspect_bgp.py @@ -38,7 +38,10 @@ def http_get(self, path): def _get_if_map_table_entry(self, match): d = None - p = self.http_get('Snh_IFMapTableShowReq') + #Changes to paging will require fetching particular element rather than entire data + table_name = re.match('(\S+?):', match) + new_table_req = 'Snh_IFMapTableShowReq?table_name=' + table_name.group(1) + '&search_string=' + match + p = self.dict_get(new_table_req) xp = p.xpath('./IFMapTableShowResp/ifmap_db/list/IFMapNodeShowInfo') f = filter(lambda x: x.xpath('./node_name')[0].text == match, xp) if 1 == len(f): diff --git a/tcutils/control/cn_introspect_utils.py b/tcutils/control/cn_introspect_utils.py index c324b9681..bebccb6cf 100644 --- a/tcutils/control/cn_introspect_utils.py +++ b/tcutils/control/cn_introspect_utils.py @@ -1,6 +1,6 @@ import logging as LOG from lxml import etree - +import re from tcutils.verification_util import * from tcutils.util import is_v6 from netaddr import IPNetwork, AddrFormatError @@ -20,7 +20,10 @@ def _join(self, *args): def _get_if_map_table_entry(self, match): d = None - p = self.dict_get('Snh_IFMapTableShowReq') + #Changes to paging will require fetching particular element rather than entire data + table_name = re.match('(\S+?):', match) + new_table_req = 'Snh_IFMapTableShowReq?table_name=' + table_name.group(1) + '&search_string=' + match + p = self.dict_get(new_table_req) xp = p.xpath('./IFMapTableShowResp/ifmap_db/list/IFMapNodeShowInfo') if not xp: # sometime ./xpath dosen't work; work around