Guest User

Untitled

a guest
May 21st, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.03 KB | None | 0 0
  1. Home
  2. Service Activation
  3. Managed Objects
  4. Aggr-ats77-test-1
  5. Scripts
  6. DLink.DxS.get_switchport
  7.  
  8. Script DLink.DxS.get_switchport on Aggr-ats77-test-1 (DLink.DxS)
  9. Script result
  10.  
  11. Task failed: <type 'exceptions.IndexError'>
  12. list index out of range
  13. START OF TRACEBACK
  14. ------------------------------------------------------------------------
  15. File: /opt/noc/sa/profiles/DLink/DxS/get_interface_status.py (Line: 28)
  16. Function: execute
  17. 21 r = []
  18. 22 # Try SNMP first
  19. 23 if self.snmp and self.access_profile.snmp_ro:
  20. 24 try:
  21. 25 # Get interface status
  22. 26 for n, s in self.snmp.join_tables("1.3.6.1.2.1.31.1.1.1.1", "1.3.6.1.2.1.2.2.1.8", bulk=True): # IF-MIB
  23. 27 if '802.1Q Encapsulation Tag' not in n and 'System' not in n:
  24. 28 ==> iface = n.split('/')[1]
  25. 29 if interface is not None:
  26. 30 if interface == iface:
  27. 31 r = [{"interface" : iface, "status" : int(s)==1}]
  28. 32 else:
  29. 33 r.append({"interface" : iface, "status" : int(s)==1})
  30. 34 return r
  31. Variables:
  32. iface = '27'
  33. self = <Script(script-172.18.244.56-DLink.DxS.get_interface_status, initial)>
  34. n = 'Black-ring1'
  35. s = '1'
  36. r = [{'interface': '1', 'status': True}, {'interface': '2', 'status': False}, {'interface': '3', 'status': False}, {'interface': '4', 'status': False}, {'interface': '5', 'status': False}, {'interface': '6', 'status': False}, {'interface': '7', 'status': False}, {'interface': '8', 'status': False}, {'interface': '9', 'status': False}, {'interface': '10', 'status': False}, {'interface': '11', 'status': False}, {'interface': '12', 'status': False}, {'interface': '13', 'status': False}, {'interface': '14', 'status': False}, {'interface': '15', 'status': False}, {'interface': '16', 'status': False}, {'interface': '17', 'status': False}, {'interface': '18', 'status': False}, {'interface': '19', 'status': False}, {'interface': '20', 'status': False}, {'interface': '21', 'status': False}, {'interface': '22', 'status': False}, {'interface': '23', 'status': True}, {'interface': '24', 'status': False}, {'interface': '25', 'status': False}, {'interface': '26', 'status': False}, {'interface': '27', 'status': False}]
  37. interface = None
  38. ------------------------------------------------------------------------
  39. File: /opt/noc/sa/script/script.py (Line: 458)
  40. Function: guarded_run
  41. 451 return result
  42. 452 except KeyError:
  43. 453 self.debug("Not in call cache: %r, %r" % (self.name,
  44. 454 self.kwargs))
  45. 455 pass
  46. 456 # Calling script body
  47. 457 self._thread_id = thread.get_ident()
  48. 458 ==> result = self.execute(**self.kwargs)
  49. 459 # Enforce interface result checking
  50. 460 for i in self.implements:
  51. 461 result = i.script_clean_result(self.profile, result)
  52. 462 # Cache result when required
  53. 463 if self.cache and self.parent is not None:
  54. 464 self.debug("Write to call cache: %s, %s, %r" % (self.name,
  55. Variables:
  56. i = <noc.sa.interfaces.igetinterfacestatus.IGetInterfaceStatus object at 0x804b05910>
  57. self = <Script(script-172.18.244.56-DLink.DxS.get_interface_status, initial)>
  58. ------------------------------------------------------------------------
  59. File: /opt/noc/sa/script/script.py (Line: 71)
  60. Function: __call__
  61. 64 self.parent = parent
  62. 65 self.script = script
  63. 66
  64. 67 def __call__(self, **kwargs):
  65. 68 """Call script"""
  66. 69 s = self.script(self.parent.profile, self.parent.activator, self.parent.access_profile,
  67. 70 parent=self.parent, **kwargs)
  68. 71 ==> return s.guarded_run()
  69. 72
  70. 73
  71. 74 class ScriptRegistry(Registry):
  72. 75 """Script registry"""
  73. 76 name = "ScriptRegistry"
  74. 77 subdir = "profiles"
  75. Variables:
  76. s = <Script(script-172.18.244.56-DLink.DxS.get_interface_status, initial)>
  77. self = <noc.sa.script.script.ScriptCallProxy object at 0x804de3b10>
  78. kwargs = {}
  79. ------------------------------------------------------------------------
  80. File: /opt/noc/sa/profiles/DLink/DxS/get_switchport.py (Line: 29)
  81. Function: execute
  82. 22 portchannels = self.scripts.get_portchannel()
  83. 23 portchannel_members = []
  84. 24 for p in portchannels:
  85. 25 portchannel_members += p["members"]
  86. 26
  87. 27 # Get interafces status
  88. 28 interface_status = {}
  89. 29 ==> for s in self.scripts.get_interface_status():
  90. 30 interface_status[s["interface"]] = s["status"]
  91. 31
  92. 32 #TODO
  93. 33 # Get 802.1ad status if supported
  94. 34 vlan_stack_status = {}
  95. 35 try:
  96. Variables:
  97. self = <Script(script-172.18.244.56-DLink.DxS.get_switchport, started 34442094720)>
  98. p = {'interface': 'T2', 'type': 'L', 'members': ['23', '24']}
  99. interface_status = {}
  100. portchannel_members = ['21', '22', '23', '24']
  101. portchannels = [{'interface': 'T1', 'type': 'L', 'members': ['21', '22']}, {'interface': 'T2', 'type': 'L', 'members': ['23', '24']}]
  102. ------------------------------------------------------------------------
  103. File: /opt/noc/sa/script/script.py (Line: 458)
  104. Function: guarded_run
  105. 451 return result
  106. 452 except KeyError:
  107. 453 self.debug("Not in call cache: %r, %r" % (self.name,
  108. 454 self.kwargs))
  109. 455 pass
  110. 456 # Calling script body
  111. 457 self._thread_id = thread.get_ident()
  112. 458 ==> result = self.execute(**self.kwargs)
  113. 459 # Enforce interface result checking
  114. 460 for i in self.implements:
  115. 461 result = i.script_clean_result(self.profile, result)
  116. 462 # Cache result when required
  117. 463 if self.cache and self.parent is not None:
  118. 464 self.debug("Write to call cache: %s, %s, %r" % (self.name,
  119. Variables:
  120. i = <noc.sa.interfaces.igetswitchport.IGetSwitchport object at 0x804b0c550>
  121. self = <Script(script-172.18.244.56-DLink.DxS.get_switchport, started 34442094720)>
  122. ------------------------------------------------------------------------
  123. File: /opt/noc/sa/script/script.py (Line: 481)
  124. Function: run
  125. 474
  126. 475 def run(self):
  127. 476 """Script thread worker method"""
  128. 477 self.debug("Running")
  129. 478 result = None
  130. 479 try:
  131. 480 with self.cancelable():
  132. 481 ==> result = self.guarded_run()
  133. 482 except TimeOutError:
  134. 483 self.error("Timed out")
  135. 484 self.e_timeout = True
  136. 485 except CancelledError:
  137. 486 self.error("Cancelled")
  138. 487 self.e_cancel = True
  139. Variables:
  140. self = <Script(script-172.18.244.56-DLink.DxS.get_switchport, started 34442094720)>
  141. r = ["<type 'exceptions.IndexError'>", 'list index out of range']
  142. result = None
  143. v = IndexError('list index out of range',)
  144. tb = <traceback object at 0x805407878>
  145. t = <type 'exceptions.IndexError'>
  146. ------------------------------------------------------------------------
  147. END OF TRACEBACK
  148.  
  149.  
  150. Run again
Add Comment
Please, Sign In to add comment