Advertisement
Guest User

Untitled

a guest
Dec 4th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.43 KB | None | 0 0
  1. <class 'noc.sa.script.exception.CLISyntaxError'> disable clipaging Available commands: .. ? clear config dir enable login logout ping show START OF TRACEBACK ------------------------------------------------------------------------ File: /opt/noc/sa/script/script.py (Line: 679) Function: cli 672 if isinstance(data, Exception): 673 # Exception captured 674 raise data 675 if not ignore_errors: 676 # Check for syntax error 677 if (self.profile.rx_pattern_syntax_error and 678 self.profile.rx_pattern_syntax_error.search(data)): 679 ==> raise self.CLISyntaxError(data) 680 # Then check for operaion error 681 if (self.profile.rx_pattern_operation_error and 682 self.profile.rx_pattern_operation_error.search(data)): 683 raise self.CLIOperationError(data) 684 # Echo cancelation 685 if self.strip_echo and data.lstrip().startswith(cmd): Variables: cmd = 'disable clipaging' nowait = False cc = 'CLI:disable clipaging' bulk_lines = None cache = {'CLI:show switch': 'show switch\nCommand: show switch\n\nDevice Type : DES-3010G Fast Ethernet Switch\nMAC Address : 00-1B-11-B3-49-74\nIP Address : 172.16.102.206 (Manual)\nVLAN Name : default\nSubnet Mask : 255.255.252.0\nDefault Gateway : 172.16.100.1\nBoot PROM Version : Build 1.01.009\nFirmware Version : Build 4.30.B25\nHardware Version : A3\nSystem Name : \nSystem Location : \nSystem Contact : \nSpanning Tree : Disabled\nLoopBack Detection : Enabled\nIGMP Snooping : Enabled\nVLAN trunk : Disabled\n802.1X : Disabled\nTELNET : Enabled(TCP 23)\nWEB : Enabled(TCP 80)\nRMON : Disabled\nSSH : Disabled\nPassword Encryption: Disabled\n\n'} command_submit = '\n' cached = False from_cache = False file = None list_re = None ignore_errors = False data = 'disable clipaging\n\nAvailable commands: \n.. ? clear config \ndir enable login logout \nping show \n\n' self = <Script(Thread-312, started 140377925678848)> ------------------------------------------------------------------------ File: /opt/noc/sa/profiles/DLink/DxS/__init__.py (Line: 82) Function: setup_session 75 76 def setup_session(self, script): 77 # Cache "show switch" command and fetch CLI Paging from it 78 match = self.rx_pager.search(script.cli("show switch", cached=True)) 79 if match: 80 self.dlink_pager = True 81 script.debug("Disabling CLI Paging...") 82 ==> script.cli("disable clipaging") 83 84 # Parse path parameters 85 for p in script.access_profile.path.split("/"): 86 if p.startswith("cluster:"): 87 self.cluster_member = p[8:].strip() 88 # Switch to cluster member, if necessary Variables: self = <noc.sa.profiles.DLink.DxS.Profile object at 0x1f5bfd0> match = None script = <Script(Thread-312, started 140377925678848)> ------------------------------------------------------------------------ File: /opt/noc/sa/script/script.py (Line: 604) Function: request_cli_provider 597 if self.cli_provider.stale: 598 raise self.TimeOutError() 599 self.debug("CLI Provider is ready") 600 # Set up session when necessary 601 if (self.profile.setup_session and 602 not self.activator.use_canned_session): 603 self.debug("Setting up session") 604 ==> self.profile.setup_session(self) 605 # Disable pager when necessary 606 if self.to_disable_pager: 607 self.debug("Disable paging") 608 self.to_disable_pager = False 609 self.cli(self.profile.command_disable_pager, ignore_errors=True) 610 return self.cli_provider Variables: s_class = <class 'noc.sa.script.telnet.CLITelnetSocket'> self = <Script(Thread-312, started 140377925678848)> ------------------------------------------------------------------------ File: /opt/noc/sa/script/script.py (Line: 582) Function: request_cli_provider 575 self.cli_wait = False 576 if isinstance(r, Exception): 577 raise r 578 579 def request_cli_provider(self): 580 """Run CLI provider if not available""" 581 if self.parent: 582 ==> self.cli_provider = self.parent.request_cli_provider() 583 elif self.cli_provider is None: 584 self.debug("Running new provider") 585 if self.access_profile.scheme == self.TELNET: 586 s_class = CLITelnetSocket 587 elif self.access_profile.scheme == self.SSH: 588 s_class = CLISSHSocket Variables: self = <Script(Thread-313, initial)> ------------------------------------------------------------------------ File: /opt/noc/sa/script/script.py (Line: 645) Function: cli 638 from_cache = True 639 elif file: 640 # Read file instead of executing command 641 with open(file) as f: 642 data = f.read() 643 else: 644 # Check CLI provider is ready 645 ==> self.request_cli_provider() 646 # Execute command 647 self.cli_provider.submit(cmd, 648 command_submit=command_submit, 649 bulk_lines=bulk_lines) 650 if self.cli_provider.is_broken_pipe: 651 raise self.CLIDisconnectedError() Variables: cmd = 'show switch' nowait = False cc = 'CLI:show switch' bulk_lines = None cache = {'CLI:show switch': 'show switch\nCommand: show switch\n\nDevice Type : DES-3010G Fast Ethernet Switch\nMAC Address : 00-1B-11-B3-49-74\nIP Address : 172.16.102.206 (Manual)\nVLAN Name : default\nSubnet Mask : 255.255.252.0\nDefault Gateway : 172.16.100.1\nBoot PROM Version : Build 1.01.009\nFirmware Version : Build 4.30.B25\nHardware Version : A3\nSystem Name : \nSystem Location : \nSystem Contact : \nSpanning Tree : Disabled\nLoopBack Detection : Enabled\nIGMP Snooping : Enabled\nVLAN trunk : Disabled\n802.1X : Disabled\nTELNET : Enabled(TCP 23)\nWEB : Enabled(TCP 80)\nRMON : Disabled\nSSH : Disabled\nPassword Encryption: Disabled\n\n'} command_submit = '\n' cached = True from_cache = False file = None list_re = None ignore_errors = False self = <Script(Thread-313, initial)> ------------------------------------------------------------------------ File: /opt/noc/sa/profiles/DLink/DxS/get_version.py (Line: 35) Function: execute 28 r"(?:Firmware Type|System [Ff]irmware [Vv]ersion)\s+:\s+" 29 r"(?P<fwt>\S+)\s*\n", re.MULTILINE | re.DOTALL) 30 rx_ser = re.compile( 31 r"(?:[Ss]erial [Nn]umber|Device S/N)\s+:\s+(?P<serial>\S+)\s*\n", 32 re.MULTILINE | re.DOTALL) 33 34 def execute(self): 35 ==> s = self.cli("show switch", cached=True) 36 match = self.re_search(self.rx_ver, s) 37 r = { 38 "vendor": "DLink", 39 "platform": match.group("platform"), 40 "version": match.group("version"), 41 "attributes": { Variables: self = <Script(Thread-313, initial)> ------------------------------------------------------------------------ File: /opt/noc/sa/script/script.py (Line: 446) Function: guarded_run 439 return result 440 except KeyError: 441 self.logger.debug("Not in call cache: %r, %r", 442 self.name, self.kwargs) 443 pass 444 # Calling script body 445 self._thread_id = thread.get_ident() 446 ==> result = self.execute(**self.kwargs) 447 # Enforce interface result checking 448 for i in self.implements: 449 result = i.script_clean_result(self.profile, result) 450 # Cache result when required 451 if self.cache and self.parent is not None: 452 self.logger.debug( Variables: i = <noc.sa.interfaces.igetversion.IGetVersion object at 0x1d4eb90> self = <Script(Thread-313, initial)> t0 = 1417702706.86837 ------------------------------------------------------------------------ File: /opt/noc/sa/script/script.py (Line: 83) Function: __call__ 76 self.script = script 77 78 def __call__(self, **kwargs): 79 """Call script""" 80 s = self.script(self.parent.profile, self.parent.activator, 81 self.parent.object_name, self.parent.access_profile, 82 parent=self.parent, **kwargs) 83 ==> return s.guarded_run() 84 85 86 class ScriptRegistry(Registry): 87 """Script registry""" 88 name = "ScriptRegistry" 89 subdir = "profiles" Variables: s = <Script(Thread-313, initial)> self = <noc.sa.script.script.ScriptCallProxy object at 0x1e36250> kwargs = {} ------------------------------------------------------------------------ File: /opt/noc/sa/script/script.py (Line: 362) Function: match_version 355 # Compile check function 356 x = cls.compile_match_filter(*args, **kwargs) 357 # Return decorated function 358 return decorate 359 360 def match_version(self, *args, **kwargs): 361 """inline version for Script.match""" 362 ==> return self.compile_match_filter(*args, **kwargs)(self, self.scripts.get_version()) 363 364 def cli_debug(self, msg, chars=None): 365 if not self.log_cli_sessions_path: 366 return 367 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ") 368 if chars: Variables: self = <Script(Thread-312, started 140377925678848)> args = (<function DxS_L2 at 0x1d49de8>,) kwargs = {} ------------------------------------------------------------------------ File: /opt/noc/sa/profiles/DLink/DxS/get_interfaces.py (Line: 154) Function: execute 147 key = match.group("ipif") 148 state = match.group("state") 149 obj = {"port": key, "state": state} 150 return key, obj, s[match.end():] 151 return None 152 153 def execute(self): 154 ==> if self.match_version(DxS_L2): 155 L2_Switch = True 156 else: 157 L2_Switch = False 158 159 rip = [] 160 try: Variables: self = <Script(Thread-312, started 140377925678848)> ------------------------------------------------------------------------ File: /opt/noc/sa/script/script.py (Line: 446) Function: guarded_run 439 return result 440 except KeyError: 441 self.logger.debug("Not in call cache: %r, %r", 442 self.name, self.kwargs) 443 pass 444 # Calling script body 445 self._thread_id = thread.get_ident() 446 ==> result = self.execute(**self.kwargs) 447 # Enforce interface result checking 448 for i in self.implements: 449 result = i.script_clean_result(self.profile, result) 450 # Cache result when required 451 if self.cache and self.parent is not None: 452 self.logger.debug( Variables: i = <noc.sa.interfaces.igetinterfaces.IGetInterfaces object at 0x1d5ca50> self = <Script(Thread-312, started 140377925678848)> t0 = 1417702706.8682 ------------------------------------------------------------------------ File: /opt/noc/sa/script/script.py (Line: 473) Function: run 466 467 def run(self): 468 """Script thread worker method""" 469 self.debug("Running") 470 result = None 471 try: 472 with self.cancelable(): 473 ==> result = self.guarded_run() 474 except self.TimeOutError: 475 self.error("Timed out") 476 self.e_timeout = True 477 except CancelledError: 478 self.error("Cancelled") 479 self.e_cancel = True Variables: self = <Script(Thread-312, started 140377925678848)> r = ["<class 'noc.sa.script.exception.CLISyntaxError'>", 'disable clipaging\n\nAvailable commands: \n.. ? clear config \ndir enable login logout \nping show \n\n'] result = None v = CLISyntaxError('disable clipaging\n\nAvailable commands: \n.. ? clear config \ndir enable login logout \nping show \n\n',) tb = <traceback object at 0x1d54680> t = <class 'noc.sa.script.exception.CLISyntaxError'> ------------------------------------------------------------------------ END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement