Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: sa/script/script.py (Line: 1017)
- Function: re_search
- 1010 Returns match object.
- 1011 rx can be string or compiled regular expression
- 1012 """
- 1013 if isinstance(rx, basestring):
- 1014 rx = re.compile(rx, flags)
- 1015 match = rx.search(s)
- 1016 if match is None:
- 1017 ==> raise self.UnexpectedResultError()
- 1018 return match
- 1019
- 1020 def re_match(self, rx, s, flags=0):
- 1021 """
- 1022 Match s against regular expression rx using re.match
- 1023 Raise UnexpectedResultError if regular expression is not matched.
- Variables:
- rx = <_sre.SRE_Pattern object at 0x3054d40>
- s = 'C2960'
- flags = 0
- self = <Script(Thread-30, initial)>
- match = None
- ------------------------------------------------------------------------
- File: sa/profiles/Cisco/IOS/get_version.py (Line: 43)
- Function: execute
- 36 if self.snmp and self.access_profile.snmp_ro:
- 37 try:
- 38 # sysDescr.0
- 39 v = self.snmp.get("1.3.6.1.2.1.1.1.0", cached=True)
- 40 if v:
- 41 match = self.re_search(self.rx_snmp_ver, v)
- 42 platform = match.group("platform")
- 43 ==> if not self.re_search(self.rx_invalid_platforms, platform):
- 44 return {
- 45 "vendor": "Cisco",
- 46 "platform": match.group("platform"),
- 47 "version": match.group("version"),
- 48 "attributes": {
- 49 "image": match.group("image"),
- Variables:
- platform = 'C2960'
- self = <Script(Thread-30, initial)>
- match = <_sre.SRE_Match object at 0x302aa08>
- v =
- '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$
- ------------------------------------------------------------------------
- File: sa/script/script.py (Line: 463)
- Function: guarded_run
- 456 return result
- 457 except KeyError:
- 458 self.logger.debug("Not in call cache: %r, %r",
- 459 self.name, self.kwargs)
- 460 pass
- 461 # Calling script body
- 462 self._thread_id = thread.get_ident()
- 463 ==> result = self.execute(**self.kwargs)
- 464 # Enforce interface result checking
- 465 for i in self.implements:
- 466 result = i.script_clean_result(self.profile, result)
- 467 # Cache result when required
- 468 if self.cache and self.parent is not None:
- 469 self.logger.debug(
- Variables:
- i = <noc.sa.interfaces.igetversion.IGetVersion object at 0x3007910>
- self = <Script(Thread-30, initial)>
- t0 = 1424943080.694177
- ------------------------------------------------------------------------
- File: sa/script/script.py (Line: 84)
- Function: __call__
- 77 self.script = script
- 78
- 79 def __call__(self, **kwargs):
- 80 """Call script"""
- 81 s = self.script(self.parent.profile, self.parent.activator,
- 82 self.parent.object_name, self.parent.access_profile,
- 83 parent=self.parent, **kwargs)
- 84 ==> return s.guarded_run()
- 85
- 86
- 87 class ScriptRegistry(Registry):
- 88 """Script registry"""
- 89 name = "ScriptRegistry"
- 90 subdir = "profiles"
- Variables:
- s = <Script(Thread-30, initial)>
- self = <noc.sa.script.script.ScriptCallProxy object at 0x318ab10>
- kwargs = {}
- ------------------------------------------------------------------------
- File: sa/script/script.py (Line: 554)
- Function: execute
- 547 def execute(self, **kwargs):
- 548 """
- 549 Default script behavior:
- 550 Pass through _execute_chain and call appropriative handler
- 551 """
- 552 if self._execute_chain and not self.name.endswith(".get_version"):
- 553 # Get version information
- 554 ==> v = self.scripts.get_version()
- 555 # Find and execute proper handler
- 556 for c, f in self._execute_chain:
- 557 if c(self, v):
- 558 return f(self, **kwargs)
- 559 # Raise error
- 560 raise NotSupportedError()
- Variables:
- self = <Script(Thread-29, started 140233119303424)>
- kwargs = {}
- ------------------------------------------------------------------------
- File: sa/script/script.py (Line: 463)
- Function: guarded_run
- 456 return result
- 457 except KeyError:
- 458 self.logger.debug("Not in call cache: %r, %r",
- 459 self.name, self.kwargs)
- 460 pass
- 461 # Calling script body
- 462 self._thread_id = thread.get_ident()
- 463 ==> result = self.execute(**self.kwargs)
- 464 # Enforce interface result checking
- 465 for i in self.implements:
- 466 result = i.script_clean_result(self.profile, result)
- 467 # Cache result when required
- 468 if self.cache and self.parent is not None:
- 469 self.logger.debug(
- Variables:
- i = <noc.sa.interfaces.igetvlans.IGetVlans object at 0x301e050>
- self = <Script(Thread-29, started 140233119303424)>
- t0 = 1424943080.693939
- ------------------------------------------------------------------------
- File: sa/script/script.py (Line: 490)
- Function: run
- 483
- 484 def run(self):
- 485 """Script thread worker method"""
- 486 self.debug("Running")
- 487 result = None
- 488 try:
- 489 with self.cancelable():
- 490 ==> result = self.guarded_run()
- 491 except self.TimeOutError:
- 492 self.error("Timed out")
- 493 self.e_timeout = True
- 494 except CancelledError:
- 495 self.error("Cancelled")
- 496 self.e_cancel = True
- Variables:
- self = <Script(Thread-29, started 140233119303424)>
- r = ["<class 'noc.sa.script.exception.UnexpectedResultError'>", '']
- result = None
- v = UnexpectedResultError()
- tb = <traceback object at 0x31830e0>
- t = <class 'noc.sa.script.exception.UnexpectedResultError'>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement