Advertisement
Guest User

Untitled

a guest
Mar 7th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.98 KB | None | 0 0
  1. 2012-03-06 16:56:05,279 script(Cisco.IOS.get_interfaces,crt01-par-ltc,**{}) failed: <class 'noc.sa.script.exception.CLISyntaxError'>
  2. show vlan brief
  3. % Ambiguous command: "show vlan brief"
  4.  
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/sa/script/script.py (Line: 586)
  8. Function: cli
  9. 579 if self.activator.to_save_output:
  10. 580 self.activator.save_interaction("cli", cmd, data)
  11. 581 if isinstance(data, Exception):
  12. 582 # Exception captured
  13. 583 raise data
  14. 584 # Check for syntax error
  15. 585 if self.profile.pattern_syntax_error and re.search(self.profile.pattern_syntax_error, data):
  16. 586 ==> raise self.CLISyntaxError(data)
  17. 587 # Echo cancelation
  18. 588 if self.strip_echo and data.lstrip().startswith(cmd):
  19. 589 data = data.lstrip()
  20. 590 if data.startswith(cmd + "\n"):
  21. 591 # Remove first line
  22. 592 data = self.strip_first_lines(data.lstrip())
  23. Variables:
  24. cmd = 'show vlan brief'
  25. cc = 'CLI:show vlan brief'
  26. bulk_lines = None
  27. cache = {'CLI:show interfaces description': 'show interfaces description\nInterface Status Protocol Description\nF
  28. command_submit = '\n'
  29. cached = False
  30. from_cache = False
  31. list_re = None
  32. data = 'show vlan brief\n% Ambiguous command: "show vlan brief"\n'
  33. self = <Script(script-192.168.65.43-Cisco.IOS.get_vlans, initial)>
  34. ------------------------------------------------------------------------
  35. File: /opt/noc/sa/profiles/Cisco/IOS/get_vlans.py (Line: 77)
  36. Function: execute_vlan_brief
  37. 70 return self.extract_vlans(vlans)
  38. 71
  39. 72 ##
  40. 73 ## Other
  41. 74 ##
  42. 75 @NOCScript.match()
  43. 76 def execute_vlan_brief(self):
  44. 77 ==> vlans = self.cli("show vlan brief")
  45. 78 return self.extract_vlans(vlans)
  46. Variables:
  47. self = <Script(script-192.168.65.43-Cisco.IOS.get_vlans, initial)>
  48. ------------------------------------------------------------------------
  49. File: /opt/noc/sa/script/script.py (Line: 496)
  50. Function: execute
  51. 489 """
  52. 490 if self._execute_chain and not self.name.endswith(".get_version"):
  53. 491 # Get version information
  54. 492 v = self.scripts.get_version()
  55. 493 # Find and execute proper handler
  56. 494 for c, f in self._execute_chain:
  57. 495 if c(self, v):
  58. 496 ==> return f(self, **kwargs)
  59. 497 # Raise error
  60. 498 raise NotSupportedError()
  61. 499
  62. 500 def cli_queue_get(self):
  63. 501 """
  64. 502 Request CLI provider's queue
  65. Variables:
  66. kwargs = {}
  67. c = <function <lambda> at 0x9a05d14>
  68. v = {'platform': '3700', 'version': '12.3(14)T7', 'vendor': 'Cisco', 'attributes': {'image': 'C3745-ADVENTERPRISEK9-M'}}
  69. self = <Script(script-192.168.65.43-Cisco.IOS.get_vlans, initial)>
  70. f = <function execute_vlan_brief at 0x9a05cdc>
  71. ------------------------------------------------------------------------
  72. File: /opt/noc/sa/script/script.py (Line: 411)
  73. Function: guarded_run
  74. 404 return result
  75. 405 except KeyError:
  76. 406 self.debug("Not in call cache: %r, %r" % (self.name,
  77. 407 self.kwargs))
  78. 408 pass
  79. 409 # Calling script body
  80. 410 self._thread_id = thread.get_ident()
  81. 411 ==> result = self.execute(**self.kwargs)
  82. 412 # Enforce interface result checking
  83. 413 for i in self.implements:
  84. 414 result = i.script_clean_result(self.profile, result)
  85. 415 # Cache result when required
  86. 416 if self.cache and self.parent is not None:
  87. 417 self.debug("Write to call cache: %s, %s, %r" % (self.name,
  88. Variables:
  89. i = <noc.sa.interfaces.igetvlans.IGetVlans object at 0x99ac78c>
  90. self = <Script(script-192.168.65.43-Cisco.IOS.get_vlans, initial)>
  91. ------------------------------------------------------------------------
  92. ------------------------------------------------------------------------
  93. File: /opt/noc/sa/script/script.py (Line: 81)
  94. Function: __call__
  95. 74 self.script = script
  96. 75
  97. 76 def __call__(self, **kwargs):
  98. 77 """Call script"""
  99. 78 s = self.script(self.parent.profile, self.parent.activator,
  100. 79 self.parent.access_profile, parent=self.parent,
  101. 80 **kwargs)
  102. 81 ==> return s.guarded_run()
  103. 82
  104. 83
  105. 84 class ScriptRegistry(Registry):
  106. 85 """Script registry"""
  107. 86 name = "ScriptRegistry"
  108. 87 subdir = "profiles"
  109. Variables:
  110. s = <Script(script-192.168.65.43-Cisco.IOS.get_vlans, initial)>
  111. self = <noc.sa.script.script.ScriptCallProxy object at 0xb4e42fcc>
  112. kwargs = {}
  113. ------------------------------------------------------------------------
  114. File: /opt/noc/sa/profiles/Cisco/IOS/get_switchport.py (Line: 66)
  115. Function: execute
  116. 59 portchannels[p["interface"]] = p["members"]
  117. 60 # Get descriptions
  118. 61 descriptions = {} # interface name -> description
  119. 62 for p in self.get_description():
  120. 63 descriptions[p["interface"]] = p["description"]
  121. 64 # Get vlans
  122. 65 known_vlans = set([vlan["vlan_id"] for vlan in
  123. 66 ==> self.scripts.get_vlans()])
  124. 67 # For each interface
  125. 68 for s in self.rx_line.split(v)[1:]:
  126. 69 match = self.rx_body.search(s)
  127. 70 if not match:
  128. 71 continue #raise self.NotSupportedError()
  129. 72
  130. Variables:
  131. self = <Script(script-192.168.65.43-Cisco.IOS.get_switchport, initial)>
  132. portchannels = {}
  133. _[1] = []
  134. p = {'interface': 'Lo 155', 'description': '= Policy ='}
  135. r = []
  136. 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
  137. v = '\n\n'
  138. ------------------------------------------------------------------------
  139. File: /opt/noc/sa/script/script.py (Line: 434)
  140. Function: run
  141. 427
  142. 428 def run(self):
  143. 429 """Script thread worker method"""
  144. 430 self.debug("Running")
  145. 431 result = None
  146. 432 try:
  147. 433 with self.cancelable():
  148. 434 ==> result = self.guarded_run()
  149. 435 except TimeOutError:
  150. 436 self.error("Timed out")
  151. 437 self.e_timeout = True
  152. 438 except CancelledError:
  153. 439 self.error("Cancelled")
  154. 440 self.e_cancel = True
  155. Variables:
  156. self = <Script(script-192.168.65.43-Cisco.IOS.get_interfaces, started -1233126544)>
  157. r = ["<class 'noc.sa.script.exception.CLISyntaxError'>", 'show vlan brief\n% Ambiguous command: "show vlan brief"\n']
  158. result = None
  159. v = CLISyntaxError('show vlan brief\n% Ambiguous command: "show vlan brief"\n',)
  160. tb = <traceback object at 0xb682652c>
  161. t = <class 'noc.sa.script.exception.CLISyntaxError'>
  162. ------------------------------------------------------------------------
  163. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement