Advertisement
Guest User

Untitled

a guest
Dec 19th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.82 KB | None | 0 0
  1. <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  2. DictParameter: '00-21-91-A7-0A-00'.
  3. START OF TRACEBACK
  4. ------------------------------------------------------------------------
  5. File: /opt/noc/sa/interfaces/base.py (Line: 55)
  6. Function: raise_error
  7. 48 :param value: Value where error detected
  8. 49 :type value: Arbitrary python type
  9. 50 :param msg: Optional message
  10. 51 :type msg: String
  11. 52 :raises InterfaceTypeError
  12. 53 """
  13. 54 raise InterfaceTypeError("%s: %s. %s" % (self.__class__.__name__,
  14. 55 ==> repr(value), msg))
  15. 56
  16. 57 def clean(self, value):
  17. 58 """
  18. 59 Input parameter normalization
  19. 60
  20. 61 :param value: Input parameter
  21. Variables:
  22. msg = ''
  23. self = <noc.sa.interfaces.base.DictParameter object at 0x803cdb7d0>
  24. value = '00-21-91-A7-0A-00'
  25. ------------------------------------------------------------------------
  26. File: /opt/noc/sa/interfaces/base.py (Line: 712)
  27. Function: script_clean_result
  28. 705 out_value[k] = v
  29. 706 return out_value
  30. 707
  31. 708 def script_clean_result(self, profile, value):
  32. 709 if value is None and self.default is not None:
  33. 710 return self.default
  34. 711 if type(value) != types.DictType:
  35. 712 ==> self.raise_error(value)
  36. 713 if not self.attrs:
  37. 714 return value
  38. 715 in_value = value.copy()
  39. 716 out_value = {}
  40. 717 for a_name, attr in self.attrs.items():
  41. 718 if a_name not in in_value and attr.required:
  42. Variables:
  43. profile = <noc.sa.profiles.DLink.DxS.Profile object at 0x80790bed0>
  44. self = <noc.sa.interfaces.base.DictParameter object at 0x803cdb7d0>
  45. value = '00-21-91-A7-0A-00'
  46. ------------------------------------------------------------------------
  47. File: /opt/noc/sa/interfaces/base.py (Line: 1305)
  48. Function: script_clean_result
  49. 1298 return self.clean(__profile, **kwargs)
  50. 1299
  51. 1300 def script_clean_result(self, __profile, result):
  52. 1301 try:
  53. 1302 rp = self.returns
  54. 1303 except AttributeError:
  55. 1304 return result
  56. 1305 ==> return rp.script_clean_result(__profile, result)
  57. 1306
  58. 1307 def template_clean_result(self, __profile, result):
  59. 1308 return result
  60. 1309
  61. 1310 def requires_input(self):
  62. 1311 for n, p in self.gen_parameters():
  63. Variables:
  64. _Interface__profile = <noc.sa.profiles.DLink.DxS.Profile object at 0x80790bed0>
  65. rp = <noc.sa.interfaces.base.DictParameter object at 0x803cdb7d0>
  66. result = '00-21-91-A7-0A-00'
  67. self = <noc.sa.interfaces.igetchassisid.IGetChassisID object at 0x806a31990>
  68. ------------------------------------------------------------------------
  69. File: /opt/noc/sa/script/script.py (Line: 420)
  70. Function: guarded_run
  71. 413 self.kwargs))
  72. 414 pass
  73. 415 # Calling script body
  74. 416 self._thread_id = thread.get_ident()
  75. 417 result = self.execute(**self.kwargs)
  76. 418 # Enforce interface result checking
  77. 419 for i in self.implements:
  78. 420 ==> result = i.script_clean_result(self.profile, result)
  79. 421 # Cache result when required
  80. 422 if self.cache and self.parent is not None:
  81. 423 self.debug("Write to call cache: %s, %s, %r" % (self.name,
  82. 424 self.kwargs,
  83. 425 result))
  84. 426 self.set_cache(self.name, self.kwargs, result)
  85. Variables:
  86. i = <noc.sa.interfaces.igetchassisid.IGetChassisID object at 0x806a31990>
  87. self = <Script(script-172.18.244.1-DLink.DxS.get_chassis_id, initial)>
  88. result = '00-21-91-A7-0A-00'
  89. ------------------------------------------------------------------------
  90. File: /opt/noc/sa/script/script.py (Line: 82)
  91. Function: __call__
  92. 75 self.script = script
  93. 76
  94. 77 def __call__(self, **kwargs):
  95. 78 """Call script"""
  96. 79 s = self.script(self.parent.profile, self.parent.activator,
  97. 80 self.parent.access_profile, parent=self.parent,
  98. 81 **kwargs)
  99. 82 ==> return s.guarded_run()
  100. 83
  101. 84
  102. 85 class ScriptRegistry(Registry):
  103. 86 """Script registry"""
  104. 87 name = "ScriptRegistry"
  105. 88 subdir = "profiles"
  106. Variables:
  107. s = <Script(script-172.18.244.1-DLink.DxS.get_chassis_id, initial)>
  108. self = <noc.sa.script.script.ScriptCallProxy object at 0x80790c390>
  109. kwargs = {}
  110. ------------------------------------------------------------------------
  111. File: /opt/noc/sa/profiles/Generic/get_discovery_id.py (Line: 33)
  112. Function: execute
  113. 26 data = {}
  114. 27 with self.cached():
  115. 28 x_list = (self.CLISyntaxError, self.NotSupportedError,
  116. 29 self.UnexpectedResultError)
  117. 30 # Get Chassis Id
  118. 31 if self.scripts.has_script("get_chassis_id"):
  119. 32 with self.ignored_exceptions(x_list):
  120. 33 ==> r = self.scripts.get_chassis_id()
  121. 34 data["first_chassis_mac"] = r["first_chassis_mac"]
  122. 35 data["last_chassis_mac"] = r["last_chassis_mac"]
  123. 36 # Get fqdn
  124. 37 if self.scripts.has_script("get_fqdn"):
  125. 38 with self.ignored_exceptions(x_list):
  126. 39 r = self.scripts.get_fqdn()
  127. Variables:
  128. self = <Script(script-172.18.244.1-Generic.get_discovery_id, started 34489841920)>
  129. data = {}
  130. x_list = (<class 'noc.sa.script.exception.CLISyntaxError'>, <class 'noc.sa.script.exception.NotSupportedError'>, <class 'noc.sa.script.exception.UnexpectedResultError'>)
  131. ------------------------------------------------------------------------
  132. File: /opt/noc/sa/script/script.py (Line: 417)
  133. Function: guarded_run
  134. 410 return result
  135. 411 except KeyError:
  136. 412 self.debug("Not in call cache: %r, %r" % (self.name,
  137. 413 self.kwargs))
  138. 414 pass
  139. 415 # Calling script body
  140. 416 self._thread_id = thread.get_ident()
  141. 417 ==> result = self.execute(**self.kwargs)
  142. 418 # Enforce interface result checking
  143. 419 for i in self.implements:
  144. 420 result = i.script_clean_result(self.profile, result)
  145. 421 # Cache result when required
  146. 422 if self.cache and self.parent is not None:
  147. 423 self.debug("Write to call cache: %s, %s, %r" % (self.name,
  148. Variables:
  149. i = <noc.sa.interfaces.igetdiscoveryid.IGetDiscoveryID object at 0x803586b90>
  150. self = <Script(script-172.18.244.1-Generic.get_discovery_id, started 34489841920)>
  151. ------------------------------------------------------------------------
  152. File: /opt/noc/sa/script/script.py (Line: 440)
  153. Function: run
  154. 433
  155. 434 def run(self):
  156. 435 """Script thread worker method"""
  157. 436 self.debug("Running")
  158. 437 result = None
  159. 438 try:
  160. 439 with self.cancelable():
  161. 440 ==> result = self.guarded_run()
  162. 441 except self.TimeOutError:
  163. 442 self.error("Timed out")
  164. 443 self.e_timeout = True
  165. 444 except CancelledError:
  166. 445 self.error("Cancelled")
  167. 446 self.e_cancel = True
  168. Variables:
  169. self = <Script(script-172.18.244.1-Generic.get_discovery_id, started 34489841920)>
  170. r = ["<class 'noc.sa.interfaces.base.InterfaceTypeError'>", "DictParameter: '00-21-91-A7-0A-00'. "]
  171. result = None
  172. v = InterfaceTypeError("DictParameter: '00-21-91-A7-0A-00'. ",)
  173. tb = <traceback object at 0x80790fea8>
  174. t = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  175. ------------------------------------------------------------------------
  176. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement