Advertisement
Guest User

Untitled

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