Advertisement
Guest User

Untitled

a guest
Feb 26th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.37 KB | None | 0 0
  1. START OF TRACEBACK
  2. ------------------------------------------------------------------------
  3. File: sa/script/script.py (Line: 1017)
  4. Function: re_search
  5. 1010 Returns match object.
  6. 1011 rx can be string or compiled regular expression
  7. 1012 """
  8. 1013 if isinstance(rx, basestring):
  9. 1014 rx = re.compile(rx, flags)
  10. 1015 match = rx.search(s)
  11. 1016 if match is None:
  12. 1017 ==> raise self.UnexpectedResultError()
  13. 1018 return match
  14. 1019
  15. 1020 def re_match(self, rx, s, flags=0):
  16. 1021 """
  17. 1022 Match s against regular expression rx using re.match
  18. 1023 Raise UnexpectedResultError if regular expression is not matched.
  19. Variables:
  20. rx = <_sre.SRE_Pattern object at 0x3054d40>
  21. s = 'C2960'
  22. flags = 0
  23. self = <Script(Thread-30, initial)>
  24. match = None
  25. ------------------------------------------------------------------------
  26. File: sa/profiles/Cisco/IOS/get_version.py (Line: 43)
  27. Function: execute
  28. 36 if self.snmp and self.access_profile.snmp_ro:
  29. 37 try:
  30. 38 # sysDescr.0
  31. 39 v = self.snmp.get("1.3.6.1.2.1.1.1.0", cached=True)
  32. 40 if v:
  33. 41 match = self.re_search(self.rx_snmp_ver, v)
  34. 42 platform = match.group("platform")
  35. 43 ==> if not self.re_search(self.rx_invalid_platforms, platform):
  36. 44 return {
  37. 45 "vendor": "Cisco",
  38. 46 "platform": match.group("platform"),
  39. 47 "version": match.group("version"),
  40. 48 "attributes": {
  41. 49 "image": match.group("image"),
  42. Variables:
  43. platform = 'C2960'
  44. self = <Script(Thread-30, initial)>
  45. match = <_sre.SRE_Match object at 0x302aa08>
  46. v =
  47. 'Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 12.2(58)SE2, RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright (c) 1986-2011 by Cisco Systems, Inc.\r\nCompiled Thu 21-Jul-11 02:1$
  48. ------------------------------------------------------------------------
  49. File: sa/script/script.py (Line: 463)
  50. Function: guarded_run
  51. 456 return result
  52. 457 except KeyError:
  53. 458 self.logger.debug("Not in call cache: %r, %r",
  54. 459 self.name, self.kwargs)
  55. 460 pass
  56. 461 # Calling script body
  57. 462 self._thread_id = thread.get_ident()
  58. 463 ==> result = self.execute(**self.kwargs)
  59. 464 # Enforce interface result checking
  60. 465 for i in self.implements:
  61. 466 result = i.script_clean_result(self.profile, result)
  62. 467 # Cache result when required
  63. 468 if self.cache and self.parent is not None:
  64. 469 self.logger.debug(
  65. Variables:
  66. i = <noc.sa.interfaces.igetversion.IGetVersion object at 0x3007910>
  67. self = <Script(Thread-30, initial)>
  68. t0 = 1424943080.694177
  69. ------------------------------------------------------------------------
  70. File: sa/script/script.py (Line: 84)
  71. Function: __call__
  72. 77 self.script = script
  73. 78
  74. 79 def __call__(self, **kwargs):
  75. 80 """Call script"""
  76. 81 s = self.script(self.parent.profile, self.parent.activator,
  77. 82 self.parent.object_name, self.parent.access_profile,
  78. 83 parent=self.parent, **kwargs)
  79. 84 ==> return s.guarded_run()
  80. 85
  81. 86
  82. 87 class ScriptRegistry(Registry):
  83. 88 """Script registry"""
  84. 89 name = "ScriptRegistry"
  85. 90 subdir = "profiles"
  86. Variables:
  87. s = <Script(Thread-30, initial)>
  88. self = <noc.sa.script.script.ScriptCallProxy object at 0x318ab10>
  89. kwargs = {}
  90. ------------------------------------------------------------------------
  91. File: sa/script/script.py (Line: 554)
  92. Function: execute
  93. 547 def execute(self, **kwargs):
  94. 548 """
  95. 549 Default script behavior:
  96. 550 Pass through _execute_chain and call appropriative handler
  97. 551 """
  98. 552 if self._execute_chain and not self.name.endswith(".get_version"):
  99. 553 # Get version information
  100. 554 ==> v = self.scripts.get_version()
  101. 555 # Find and execute proper handler
  102. 556 for c, f in self._execute_chain:
  103. 557 if c(self, v):
  104. 558 return f(self, **kwargs)
  105. 559 # Raise error
  106. 560 raise NotSupportedError()
  107. Variables:
  108. self = <Script(Thread-29, started 140233119303424)>
  109. kwargs = {}
  110. ------------------------------------------------------------------------
  111. File: sa/script/script.py (Line: 463)
  112. Function: guarded_run
  113. 456 return result
  114. 457 except KeyError:
  115. 458 self.logger.debug("Not in call cache: %r, %r",
  116. 459 self.name, self.kwargs)
  117. 460 pass
  118. 461 # Calling script body
  119. 462 self._thread_id = thread.get_ident()
  120. 463 ==> result = self.execute(**self.kwargs)
  121. 464 # Enforce interface result checking
  122. 465 for i in self.implements:
  123. 466 result = i.script_clean_result(self.profile, result)
  124. 467 # Cache result when required
  125. 468 if self.cache and self.parent is not None:
  126. 469 self.logger.debug(
  127. Variables:
  128. i = <noc.sa.interfaces.igetvlans.IGetVlans object at 0x301e050>
  129. self = <Script(Thread-29, started 140233119303424)>
  130. t0 = 1424943080.693939
  131. ------------------------------------------------------------------------
  132. File: sa/script/script.py (Line: 490)
  133. Function: run
  134. 483
  135. 484 def run(self):
  136. 485 """Script thread worker method"""
  137. 486 self.debug("Running")
  138. 487 result = None
  139. 488 try:
  140. 489 with self.cancelable():
  141. 490 ==> result = self.guarded_run()
  142. 491 except self.TimeOutError:
  143. 492 self.error("Timed out")
  144. 493 self.e_timeout = True
  145. 494 except CancelledError:
  146. 495 self.error("Cancelled")
  147. 496 self.e_cancel = True
  148. Variables:
  149. self = <Script(Thread-29, started 140233119303424)>
  150. r = ["<class 'noc.sa.script.exception.UnexpectedResultError'>", '']
  151. result = None
  152. v = UnexpectedResultError()
  153. tb = <traceback object at 0x31830e0>
  154. t = <class 'noc.sa.script.exception.UnexpectedResultError'>
  155. ------------------------------------------------------------------------
  156. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement