Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <type 'exceptions.NameError'> global name 'rx_line' is not defined
- START OF TRACEBACK ------------------------------------------------------------------------
- File: sa/profiles/Brocade/IronWare/get_arp.py (Line: 25) Function: execute
- 18 implements = [IGetARP] 19 rx_line = re.compile(r"^\d+\s+(?P<ip>\S+)\s+(?P<mac>\S+)\s+(?P<type>\S+)\s+\d+\s+(?P<interface>\S+)")
- 20
- 21 def execute(self):
- 22 s = self.cli("show arp")
- 23 r = []
- 24 for l in s.splitlines():
- 25 ==> match = rx_line.match(l.strip())
- 26 if not match:
- 27 continue
- 28 type = match.group("type")
- 29 mac = match.group("mac")
- 30 if (mac.lower() in ("incomplete" or "none") or
- 31 type.lower() in ("pending", "invalid")): Variables: s = 'Total number of ARP entries: 10\n IP Address MAC Address Type Age Port \n1 172.30.2.1 001f.2780.d800 Dynamic 0 mgmt1 \n2 172.30.2.63 00c0.3d03.be2a Dynamic 2 mgmt1 \n3 91.210.5.225 001b.1700.0130 Dynamic 0 7T \n4 91.210.5.230 768e.f8d2.05e6 Dynamic 0 7T \n5 172.30.5.1 001f.2780.d800 Dynamic 0 7T \n6 172.30.5.76 768e.f81e.054c Dynamic 0 7T \n7 172.30.5.77 0050.568e.7572 Dynamic 0 7T \n8 172.30.5.78 0050.568e.7571 Dynamic 0 7T \n9 172.30.5.100 eabd.4f3e.6908 Dynamic 0 7T \n10 172.30.5.111 768e.f81e.056f Dynamic 0 7T \n' r = [] l = 'Total number of ARP entries: 10' self = <Script(Thread-218835, initial)>
- ------------------------------------------------------------------------
- File: sa/script/script.py (Line: 446) Function: guarded_run
- 439 return result
- 440 except KeyError:
- 441 self.logger.debug("Not in call cache: %r, %r",
- 442 self.name, self.kwargs)
- 443 pass
- 444 # Calling script body
- 445 self._thread_id = thread.get_ident()
- 446 ==> result = self.execute(**self.kwargs)
- 447 # Enforce interface result checking
- 448 for i in self.implements:
- 449 result = i.script_clean_result(self.profile, result)
- 450 # Cache result when required
- 451 if self.cache and self.parent is not None:
- 452 self.logger.debug( Variables: i = <noc.sa.interfaces.igetarp.IGetARP object at 0x1f33190> self = <Script(Thread-218835, initial)> t0 = 1421326689.460199
- ------------------------------------------------------------------------
- File: sa/script/script.py (Line: 83) Function: __call__
- 76 self.script = script
- 77
- 78 def __call__(self, **kwargs):
- 79 """Call script"""
- 80 s = self.script(self.parent.profile, self.parent.activator,
- 81 self.parent.object_name, self.parent.access_profile,
- 82 parent=self.parent, **kwargs)
- 83 ==> return s.guarded_run()
- 84
- 85
- 86 class ScriptRegistry(Registry):
- 87 """Script registry"""
- 88 name = "ScriptRegistry"
- 89 subdir = "profiles" Variables: s = <Script(Thread-218835, initial)> self = <noc.sa.script.script.ScriptCallProxy object at 0x20fd210> kwargs = {'vrf': None}
- ------------------------------------------------------------------------
- File: sa/profiles/Generic/get_ip_discovery.py (Line: 67) Function: execute 60 ]
- 61 # Iterate through VRF
- 62 data = []
- 63 for v in vrfs:
- 64 a = []
- 65 vrf = None if v == "default" else v
- 66 # Process ARP cache
- 67 ==> arp_cache = self.scripts.get_arp(vrf=vrf)
- 68 a += [{
- 69 "ip": x["ip"],
- 70 "afi": "4",
- 71 "mac": x["mac"],
- 72 "interface": x["interface"]
- 73 } for x in arp_cache if "mac" in x and x["mac"]] Variables: a = [] self = <Script(Thread-218834, started 139688845244160)> vrfs = {'default': {'name': 'default', 'addresses': []}} v = 'default' data = [] vrf = None
- ------------------------------------------------------------------------
- File: sa/script/script.py (Line: 446) Function: guarded_run 439 return result 440 except KeyError: 441 self.logger.debug("Not in call cache: %r, %r", 442 self.name, self.kwargs) 443 pass 444 # Calling script body 445 self._thread_id = thread.get_ident() 446 ==> result = self.execute(**self.kwargs) 447 # Enforce interface result checking 448 for i in self.implements: 449 result = i.script_clean_result(self.profile, result) 450 # Cache result when required 451 if self.cache and self.parent is not None: 452 self.logger.debug( Variables: i = <noc.sa.interfaces.igetipdiscovery.IGetIPDiscovery object at 0x1c8b0d0> self = <Script(Thread-218834, started 139688845244160)> t0 = 1421326689.460049
- ------------------------------------------------------------------------
- File: sa/script/script.py (Line: 473) Function: run 466 467 def run(self): 468 """Script thread worker method""" 469 self.debug("Running") 470 result = None 471 try: 472 with self.cancelable(): 473 ==> result = self.guarded_run() 474 except self.TimeOutError: 475 self.error("Timed out") 476 self.e_timeout = True 477 except CancelledError: 478 self.error("Cancelled") 479 self.e_cancel = True Variables: self = <Script(Thread-218834, started 139688845244160)> r = ["<type 'exceptions.NameError'>", "global name 'rx_line' is not defined"] result = None v = NameError("global name 'rx_line' is not defined",) tb = <traceback object at 0x2392bd8> t = <type 'exceptions.NameError'>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement