Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <class 'noc.sa.interfaces.base.InterfaceTypeError'>
- DictParameter: '00-21-91-A7-0A-00'.
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/interfaces/base.py (Line: 55)
- Function: raise_error
- 48 :param value: Value where error detected
- 49 :type value: Arbitrary python type
- 50 :param msg: Optional message
- 51 :type msg: String
- 52 :raises InterfaceTypeError
- 53 """
- 54 raise InterfaceTypeError("%s: %s. %s" % (self.__class__.__name__,
- 55 ==> repr(value), msg))
- 56
- 57 def clean(self, value):
- 58 """
- 59 Input parameter normalization
- 60
- 61 :param value: Input parameter
- Variables:
- msg = ''
- self = <noc.sa.interfaces.base.DictParameter object at 0x803cdb7d0>
- value = '00-21-91-A7-0A-00'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/interfaces/base.py (Line: 712)
- Function: script_clean_result
- 705 out_value[k] = v
- 706 return out_value
- 707
- 708 def script_clean_result(self, profile, value):
- 709 if value is None and self.default is not None:
- 710 return self.default
- 711 if type(value) != types.DictType:
- 712 ==> self.raise_error(value)
- 713 if not self.attrs:
- 714 return value
- 715 in_value = value.copy()
- 716 out_value = {}
- 717 for a_name, attr in self.attrs.items():
- 718 if a_name not in in_value and attr.required:
- Variables:
- profile = <noc.sa.profiles.DLink.DxS.Profile object at 0x80790bed0>
- self = <noc.sa.interfaces.base.DictParameter object at 0x803cdb7d0>
- value = '00-21-91-A7-0A-00'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/interfaces/base.py (Line: 1305)
- Function: script_clean_result
- 1298 return self.clean(__profile, **kwargs)
- 1299
- 1300 def script_clean_result(self, __profile, result):
- 1301 try:
- 1302 rp = self.returns
- 1303 except AttributeError:
- 1304 return result
- 1305 ==> return rp.script_clean_result(__profile, result)
- 1306
- 1307 def template_clean_result(self, __profile, result):
- 1308 return result
- 1309
- 1310 def requires_input(self):
- 1311 for n, p in self.gen_parameters():
- Variables:
- _Interface__profile = <noc.sa.profiles.DLink.DxS.Profile object at 0x80790bed0>
- rp = <noc.sa.interfaces.base.DictParameter object at 0x803cdb7d0>
- result = '00-21-91-A7-0A-00'
- self = <noc.sa.interfaces.igetchassisid.IGetChassisID object at 0x806a31990>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 420)
- Function: guarded_run
- 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,
- 424 self.kwargs,
- 425 result))
- 426 self.set_cache(self.name, self.kwargs, result)
- Variables:
- i = <noc.sa.interfaces.igetchassisid.IGetChassisID object at 0x806a31990>
- self = <Script(script-172.18.244.1-DLink.DxS.get_chassis_id, initial)>
- result = '00-21-91-A7-0A-00'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 82)
- Function: __call__
- 75 self.script = script
- 76
- 77 def __call__(self, **kwargs):
- 78 """Call script"""
- 79 s = self.script(self.parent.profile, self.parent.activator,
- 80 self.parent.access_profile, parent=self.parent,
- 81 **kwargs)
- 82 ==> return s.guarded_run()
- 83
- 84
- 85 class ScriptRegistry(Registry):
- 86 """Script registry"""
- 87 name = "ScriptRegistry"
- 88 subdir = "profiles"
- Variables:
- s = <Script(script-172.18.244.1-DLink.DxS.get_chassis_id, initial)>
- self = <noc.sa.script.script.ScriptCallProxy object at 0x80790c390>
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/Generic/get_discovery_id.py (Line: 33)
- Function: execute
- 26 data = {}
- 27 with self.cached():
- 28 x_list = (self.CLISyntaxError, self.NotSupportedError,
- 29 self.UnexpectedResultError)
- 30 # Get Chassis Id
- 31 if self.scripts.has_script("get_chassis_id"):
- 32 with self.ignored_exceptions(x_list):
- 33 ==> r = self.scripts.get_chassis_id()
- 34 data["first_chassis_mac"] = r["first_chassis_mac"]
- 35 data["last_chassis_mac"] = r["last_chassis_mac"]
- 36 # Get fqdn
- 37 if self.scripts.has_script("get_fqdn"):
- 38 with self.ignored_exceptions(x_list):
- 39 r = self.scripts.get_fqdn()
- Variables:
- self = <Script(script-172.18.244.1-Generic.get_discovery_id, started 34489841920)>
- data = {}
- x_list = (<class 'noc.sa.script.exception.CLISyntaxError'>, <class 'noc.sa.script.exception.NotSupportedError'>, <class 'noc.sa.script.exception.UnexpectedResultError'>)
- ------------------------------------------------------------------------
- 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.igetdiscoveryid.IGetDiscoveryID object at 0x803586b90>
- self = <Script(script-172.18.244.1-Generic.get_discovery_id, started 34489841920)>
- ------------------------------------------------------------------------
- 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-172.18.244.1-Generic.get_discovery_id, started 34489841920)>
- r = ["<class 'noc.sa.interfaces.base.InterfaceTypeError'>", "DictParameter: '00-21-91-A7-0A-00'. "]
- result = None
- v = InterfaceTypeError("DictParameter: '00-21-91-A7-0A-00'. ",)
- tb = <traceback object at 0x80790fea8>
- t = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement