Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 935)
- Function: re_search
- 928 Returns match object.
- 929 rx can be string or compiled regular expression
- 930 """
- 931 if isinstance(rx, basestring):
- 932 rx = re.compile(rx, flags)
- 933 match = rx.search(s)
- 934 if match is None:
- 935 ==> raise self.UnexpectedResultError()
- 936 return match
- 937
- 938 def re_match(self, rx, s, flags=0):
- 939 """
- 940 Match s against regular expression rx using re.match
- 941 Raise UnexpectedResultError if regular expression is not matched.
- Variables:
- rx = <_sre.SRE_Pattern object at 0x2194930>
- s = '\n LLDP Remote Devices Information Detail\n\n\n'
- flags = 0
- self = <Script(script-10.12.70.5-EdgeCore.ES.get_lldp_neighbors, started 140283957638912)>
- match = None
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/EdgeCore/ES/get_lldp_neighbors.py (Line: 55)
- Function: execute_35
- 48 "local_interface": match.group("local_if"),
- 49 "neighbors": [],
- 50 }]
- 51 for i in ifs:
- 52 if i["local_interface"] in local_port_ids:
- 53 i["local_interface_id"] = local_port_ids[i["local_interface"]]
- 54 v = self.cli("show lldp info remote detail %s" % i["local_interface"])
- 55 ==> match = self.re_search(self.rx_detail, v)
- 56 n = {"remote_chassis_id_subtype": 4}
- 57 if match:
- 58 n["remote_port_subtype"] = {"MAC Address": 3, "Interface name": 5, "Inerface alias": 5, "Local": 7}[match.group("p_type")]
- 59 if n["remote_port_subtype"] == 3:
- 60 remote_port = MACAddressParameter().clean(match.group("p_id"))
- 61 else:
- Variables:
- ifs = [{'neighbors': [], 'local_interface': 'Eth 1/25', 'local_interface_id': '00:12:CF:EC:91:A2'}, {'neighbors': [], 'local_interface': 'Eth
- 1/26'}]
- i = {'neighbors': [], 'local_interface': 'Eth 1/25', 'local_interface_id': '00:12:CF:EC:91:A2'}
- self = <Script(script-10.12.70.5-EdgeCore.ES.get_lldp_neighbors, started 140283957638912)>
- local_port_ids = {'Eth 1/25': '00:12:CF:EC:91:A2', 'Eth 1/24': '00:12:CF:EC:91:A1', 'Eth 1/27': '00:12:CF:EC:91:A4', 'Eth 1/26': '00:12:CF:EC:91:A3', 'E
- th 1/21': '00:12:CF:EC:91:9E', 'Eth 1/20': '00:12:CF:EC:91:9D', 'Eth 1/23': '00:12:CF:EC:91:A0', 'Eth 1/22': '00:12:CF:EC:91:9F', 'Eth 1/28': '00:12:CF:EC:91:
- A5', 'Eth 1/8': '00:12:CF:EC:91:91', 'Eth 1/9': '00:12:CF:EC:91:92', 'Eth 1/2': '00:12:CF:EC:91:8B', 'Eth 1/3': '00:12:CF:EC:91:8C', 'Eth 1/1': '00:12:CF:EC:9
- 1:8A', 'Eth 1/6': '00:12:CF:EC:91:8F', 'Eth 1/7': '00:12:CF:EC:91:90', 'Eth 1/4': '00:12:CF:EC:91:8D', 'Eth 1/5': '00:12:CF:EC:91:8E', 'Eth 1/18': '00:12:CF:E
- C:91:9B', 'Eth 1/19': '00:12:CF:EC:91:9C', 'Eth 1/14': '00:12:CF:EC:91:97', 'Eth 1/15': '00:12:CF:EC:91:98', 'Eth 1/16': '00:12:CF:EC:91:99', 'Eth 1/17': '00:
- 12:CF:EC:91:9A', 'Eth 1/10': '00:12:CF:EC:91:93', 'Eth 1/11': '00:12:CF:EC:91:94', 'Eth 1/12': '00:12:CF:EC:91:95', 'Eth 1/13': '00:12:CF:EC:91:96'}
- local_id = '00-12-CF-EC-91-A5'
- v = '\n LLDP Remote Devices Information Detail\n\n\n'
- r = []
- port = '1/28'
- match = <_sre.SRE_Match object at 0x259aae0>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 505)
- Function: execute
- 498 """
- 499 if self._execute_chain and not self.name.endswith(".get_version"):
- 500 # Get version information
- 501 v = self.scripts.get_version()
- 502 # Find and execute proper handler
- 503 for c, f in self._execute_chain:
- 504 if c(self, v):
- 505 ==> return f(self, **kwargs)
- 506 # Raise error
- 507 raise NotSupportedError()
- 508
- 509 def cli_queue_get(self):
- 510 """
- 511 Request CLI provider's queue
- Variables:
- kwargs = {}
- c = <function <lambda> at 0x212b1b8>
- v = {'platform': 'ES3528M', 'version': '1.4.8.8', 'vendor': 'EdgeCore', 'attributes': {'HW version': 'R01', 'Serial Number': '944002900'}}
- self = <Script(script-10.12.70.5-EdgeCore.ES.get_lldp_neighbors, started 140283957638912)>
- f = <function execute_35 at 0x212b140>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 417)
- Function: guarded_run
- 410 return result
- 411 except KeyError:
- 412 self.debug("Not in call cache: %r, %r" % (self.name,
- 413 self.kwargs))
- 414 pass
- 415 # Calling script body
- 416 self._thread_id = thread.get_ident()
- 417 ==> result = self.execute(**self.kwargs)
- 418 # Enforce interface result checking
- 419 for i in self.implements:
- 420 result = i.script_clean_result(self.profile, result)
- 421 # Cache result when required
- 422 if self.cache and self.parent is not None:
- 423 self.debug("Write to call cache: %s, %s, %r" % (self.name,
- Variables:
- i = <noc.sa.interfaces.igetlldpneighbors.IGetLLDPNeighbors object at 0x2125910>
- self = <Script(script-10.12.70.5-EdgeCore.ES.get_lldp_neighbors, started 140283957638912)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 440)
- Function: run
- 433
- 434 def run(self):
- 435 """Script thread worker method"""
- 436 self.debug("Running")
- 437 result = None
- 438 try:
- 439 with self.cancelable():
- 440 ==> result = self.guarded_run()
- 441 except self.TimeOutError:
- 442 self.error("Timed out")
- 443 self.e_timeout = True
- 444 except CancelledError:
- 445 self.error("Cancelled")
- 446 self.e_cancel = True
- Variables:
- self = <Script(script-10.12.70.5-EdgeCore.ES.get_lldp_neighbors, started 140283957638912)>
- r = ["<class 'noc.sa.script.exception.UnexpectedResultError'>", '']
- result = None
- v = UnexpectedResultError()
- tb = <traceback object at 0x7f965801b0e0>
- t = <class 'noc.sa.script.exception.UnexpectedResultError'>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement