Advertisement
Guest User

Untitled

a guest
Jan 15th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.95 KB | None | 0 0
  1. <type 'exceptions.NameError'> global name 'rx_line' is not defined
  2. START OF TRACEBACK ------------------------------------------------------------------------
  3. File: sa/profiles/Brocade/IronWare/get_arp.py (Line: 25) Function: execute
  4. 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+)")
  5. 20
  6. 21 def execute(self):
  7. 22 s = self.cli("show arp")
  8. 23 r = []
  9. 24 for l in s.splitlines():
  10. 25 ==> match = rx_line.match(l.strip())
  11. 26 if not match:
  12. 27 continue
  13. 28 type = match.group("type")
  14. 29 mac = match.group("mac")
  15. 30 if (mac.lower() in ("incomplete" or "none") or
  16. 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)>
  17. ------------------------------------------------------------------------
  18. File: sa/script/script.py (Line: 446) Function: guarded_run
  19. 439 return result
  20. 440 except KeyError:
  21. 441 self.logger.debug("Not in call cache: %r, %r",
  22. 442 self.name, self.kwargs)
  23. 443 pass
  24. 444 # Calling script body
  25. 445 self._thread_id = thread.get_ident()
  26. 446 ==> result = self.execute(**self.kwargs)
  27. 447 # Enforce interface result checking
  28. 448 for i in self.implements:
  29. 449 result = i.script_clean_result(self.profile, result)
  30. 450 # Cache result when required
  31. 451 if self.cache and self.parent is not None:
  32. 452 self.logger.debug( Variables: i = <noc.sa.interfaces.igetarp.IGetARP object at 0x1f33190> self = <Script(Thread-218835, initial)> t0 = 1421326689.460199
  33. ------------------------------------------------------------------------
  34. File: sa/script/script.py (Line: 83) Function: __call__
  35. 76 self.script = script
  36. 77
  37. 78 def __call__(self, **kwargs):
  38. 79 """Call script"""
  39. 80 s = self.script(self.parent.profile, self.parent.activator,
  40. 81 self.parent.object_name, self.parent.access_profile,
  41. 82 parent=self.parent, **kwargs)
  42. 83 ==> return s.guarded_run()
  43. 84
  44. 85
  45. 86 class ScriptRegistry(Registry):
  46. 87 """Script registry"""
  47. 88 name = "ScriptRegistry"
  48. 89 subdir = "profiles" Variables: s = <Script(Thread-218835, initial)> self = <noc.sa.script.script.ScriptCallProxy object at 0x20fd210> kwargs = {'vrf': None}
  49. ------------------------------------------------------------------------
  50. File: sa/profiles/Generic/get_ip_discovery.py (Line: 67) Function: execute 60 ]
  51. 61 # Iterate through VRF
  52. 62 data = []
  53. 63 for v in vrfs:
  54. 64 a = []
  55. 65 vrf = None if v == "default" else v
  56. 66 # Process ARP cache
  57. 67 ==> arp_cache = self.scripts.get_arp(vrf=vrf)
  58. 68 a += [{
  59. 69 "ip": x["ip"],
  60. 70 "afi": "4",
  61. 71 "mac": x["mac"],
  62. 72 "interface": x["interface"]
  63. 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
  64. ------------------------------------------------------------------------
  65. 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
  66. ------------------------------------------------------------------------
  67. 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'>
  68. ------------------------------------------------------------------------
  69. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement