Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2012-03-06 16:56:05,279 script(Cisco.IOS.get_interfaces,crt01-par-ltc,**{}) failed: <class 'noc.sa.script.exception.CLISyntaxError'>
- show vlan brief
- % Ambiguous command: "show vlan brief"
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 586)
- Function: cli
- 579 if self.activator.to_save_output:
- 580 self.activator.save_interaction("cli", cmd, data)
- 581 if isinstance(data, Exception):
- 582 # Exception captured
- 583 raise data
- 584 # Check for syntax error
- 585 if self.profile.pattern_syntax_error and re.search(self.profile.pattern_syntax_error, data):
- 586 ==> raise self.CLISyntaxError(data)
- 587 # Echo cancelation
- 588 if self.strip_echo and data.lstrip().startswith(cmd):
- 589 data = data.lstrip()
- 590 if data.startswith(cmd + "\n"):
- 591 # Remove first line
- 592 data = self.strip_first_lines(data.lstrip())
- Variables:
- cmd = 'show vlan brief'
- cc = 'CLI:show vlan brief'
- bulk_lines = None
- cache = {'CLI:show interfaces description': 'show interfaces description\nInterface Status Protocol Description\nF
- command_submit = '\n'
- cached = False
- from_cache = False
- list_re = None
- data = 'show vlan brief\n% Ambiguous command: "show vlan brief"\n'
- self = <Script(script-192.168.65.43-Cisco.IOS.get_vlans, initial)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/Cisco/IOS/get_vlans.py (Line: 77)
- Function: execute_vlan_brief
- 70 return self.extract_vlans(vlans)
- 71
- 72 ##
- 73 ## Other
- 74 ##
- 75 @NOCScript.match()
- 76 def execute_vlan_brief(self):
- 77 ==> vlans = self.cli("show vlan brief")
- 78 return self.extract_vlans(vlans)
- Variables:
- self = <Script(script-192.168.65.43-Cisco.IOS.get_vlans, initial)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 496)
- Function: execute
- 489 """
- 490 if self._execute_chain and not self.name.endswith(".get_version"):
- 491 # Get version information
- 492 v = self.scripts.get_version()
- 493 # Find and execute proper handler
- 494 for c, f in self._execute_chain:
- 495 if c(self, v):
- 496 ==> return f(self, **kwargs)
- 497 # Raise error
- 498 raise NotSupportedError()
- 499
- 500 def cli_queue_get(self):
- 501 """
- 502 Request CLI provider's queue
- Variables:
- kwargs = {}
- c = <function <lambda> at 0x9a05d14>
- v = {'platform': '3700', 'version': '12.3(14)T7', 'vendor': 'Cisco', 'attributes': {'image': 'C3745-ADVENTERPRISEK9-M'}}
- self = <Script(script-192.168.65.43-Cisco.IOS.get_vlans, initial)>
- f = <function execute_vlan_brief at 0x9a05cdc>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 411)
- Function: guarded_run
- 404 return result
- 405 except KeyError:
- 406 self.debug("Not in call cache: %r, %r" % (self.name,
- 407 self.kwargs))
- 408 pass
- 409 # Calling script body
- 410 self._thread_id = thread.get_ident()
- 411 ==> result = self.execute(**self.kwargs)
- 412 # Enforce interface result checking
- 413 for i in self.implements:
- 414 result = i.script_clean_result(self.profile, result)
- 415 # Cache result when required
- 416 if self.cache and self.parent is not None:
- 417 self.debug("Write to call cache: %s, %s, %r" % (self.name,
- Variables:
- i = <noc.sa.interfaces.igetvlans.IGetVlans object at 0x99ac78c>
- self = <Script(script-192.168.65.43-Cisco.IOS.get_vlans, initial)>
- ------------------------------------------------------------------------
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 81)
- Function: __call__
- 74 self.script = script
- 75
- 76 def __call__(self, **kwargs):
- 77 """Call script"""
- 78 s = self.script(self.parent.profile, self.parent.activator,
- 79 self.parent.access_profile, parent=self.parent,
- 80 **kwargs)
- 81 ==> return s.guarded_run()
- 82
- 83
- 84 class ScriptRegistry(Registry):
- 85 """Script registry"""
- 86 name = "ScriptRegistry"
- 87 subdir = "profiles"
- Variables:
- s = <Script(script-192.168.65.43-Cisco.IOS.get_vlans, initial)>
- self = <noc.sa.script.script.ScriptCallProxy object at 0xb4e42fcc>
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/Cisco/IOS/get_switchport.py (Line: 66)
- Function: execute
- 59 portchannels[p["interface"]] = p["members"]
- 60 # Get descriptions
- 61 descriptions = {} # interface name -> description
- 62 for p in self.get_description():
- 63 descriptions[p["interface"]] = p["description"]
- 64 # Get vlans
- 65 known_vlans = set([vlan["vlan_id"] for vlan in
- 66 ==> self.scripts.get_vlans()])
- 67 # For each interface
- 68 for s in self.rx_line.split(v)[1:]:
- 69 match = self.rx_body.search(s)
- 70 if not match:
- 71 continue #raise self.NotSupportedError()
- 72
- Variables:
- self = <Script(script-192.168.65.43-Cisco.IOS.get_switchport, initial)>
- portchannels = {}
- _[1] = []
- p = {'interface': 'Lo 155', 'description': '= Policy ='}
- r = []
- descriptions = {'Fa 0/0.80': 'SberBank', 'Fa 0/0.91': '= MarRegGaz =', 'Fa 0/0.118': '= NALOG MPLS/VPN =', 'Fa 0/0.2072': '= INSIDE PAR MGMT =', 'Fa 0
- v = '\n\n'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 434)
- Function: run
- 427
- 428 def run(self):
- 429 """Script thread worker method"""
- 430 self.debug("Running")
- 431 result = None
- 432 try:
- 433 with self.cancelable():
- 434 ==> result = self.guarded_run()
- 435 except TimeOutError:
- 436 self.error("Timed out")
- 437 self.e_timeout = True
- 438 except CancelledError:
- 439 self.error("Cancelled")
- 440 self.e_cancel = True
- Variables:
- self = <Script(script-192.168.65.43-Cisco.IOS.get_interfaces, started -1233126544)>
- r = ["<class 'noc.sa.script.exception.CLISyntaxError'>", 'show vlan brief\n% Ambiguous command: "show vlan brief"\n']
- result = None
- v = CLISyntaxError('show vlan brief\n% Ambiguous command: "show vlan brief"\n',)
- tb = <traceback object at 0xb682652c>
- t = <class 'noc.sa.script.exception.CLISyntaxError'>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement