Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Home
- Service Activation
- Managed Objects
- Aggr-ats77-test-1
- Scripts
- DLink.DxS.get_switchport
- Script DLink.DxS.get_switchport on Aggr-ats77-test-1 (DLink.DxS)
- Script result
- Task failed: <type 'exceptions.IndexError'>
- list index out of range
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/DLink/DxS/get_interface_status.py (Line: 28)
- Function: execute
- 21 r = []
- 22 # Try SNMP first
- 23 if self.snmp and self.access_profile.snmp_ro:
- 24 try:
- 25 # Get interface status
- 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
- 27 if '802.1Q Encapsulation Tag' not in n and 'System' not in n:
- 28 ==> iface = n.split('/')[1]
- 29 if interface is not None:
- 30 if interface == iface:
- 31 r = [{"interface" : iface, "status" : int(s)==1}]
- 32 else:
- 33 r.append({"interface" : iface, "status" : int(s)==1})
- 34 return r
- Variables:
- iface = '27'
- self = <Script(script-172.18.244.56-DLink.DxS.get_interface_status, initial)>
- n = 'Black-ring1'
- s = '1'
- 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}]
- interface = None
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 458)
- Function: guarded_run
- 451 return result
- 452 except KeyError:
- 453 self.debug("Not in call cache: %r, %r" % (self.name,
- 454 self.kwargs))
- 455 pass
- 456 # Calling script body
- 457 self._thread_id = thread.get_ident()
- 458 ==> result = self.execute(**self.kwargs)
- 459 # Enforce interface result checking
- 460 for i in self.implements:
- 461 result = i.script_clean_result(self.profile, result)
- 462 # Cache result when required
- 463 if self.cache and self.parent is not None:
- 464 self.debug("Write to call cache: %s, %s, %r" % (self.name,
- Variables:
- i = <noc.sa.interfaces.igetinterfacestatus.IGetInterfaceStatus object at 0x804b05910>
- self = <Script(script-172.18.244.56-DLink.DxS.get_interface_status, initial)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 71)
- Function: __call__
- 64 self.parent = parent
- 65 self.script = script
- 66
- 67 def __call__(self, **kwargs):
- 68 """Call script"""
- 69 s = self.script(self.parent.profile, self.parent.activator, self.parent.access_profile,
- 70 parent=self.parent, **kwargs)
- 71 ==> return s.guarded_run()
- 72
- 73
- 74 class ScriptRegistry(Registry):
- 75 """Script registry"""
- 76 name = "ScriptRegistry"
- 77 subdir = "profiles"
- Variables:
- s = <Script(script-172.18.244.56-DLink.DxS.get_interface_status, initial)>
- self = <noc.sa.script.script.ScriptCallProxy object at 0x804de3b10>
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/DLink/DxS/get_switchport.py (Line: 29)
- Function: execute
- 22 portchannels = self.scripts.get_portchannel()
- 23 portchannel_members = []
- 24 for p in portchannels:
- 25 portchannel_members += p["members"]
- 26
- 27 # Get interafces status
- 28 interface_status = {}
- 29 ==> for s in self.scripts.get_interface_status():
- 30 interface_status[s["interface"]] = s["status"]
- 31
- 32 #TODO
- 33 # Get 802.1ad status if supported
- 34 vlan_stack_status = {}
- 35 try:
- Variables:
- self = <Script(script-172.18.244.56-DLink.DxS.get_switchport, started 34442094720)>
- p = {'interface': 'T2', 'type': 'L', 'members': ['23', '24']}
- interface_status = {}
- portchannel_members = ['21', '22', '23', '24']
- portchannels = [{'interface': 'T1', 'type': 'L', 'members': ['21', '22']}, {'interface': 'T2', 'type': 'L', 'members': ['23', '24']}]
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 458)
- Function: guarded_run
- 451 return result
- 452 except KeyError:
- 453 self.debug("Not in call cache: %r, %r" % (self.name,
- 454 self.kwargs))
- 455 pass
- 456 # Calling script body
- 457 self._thread_id = thread.get_ident()
- 458 ==> result = self.execute(**self.kwargs)
- 459 # Enforce interface result checking
- 460 for i in self.implements:
- 461 result = i.script_clean_result(self.profile, result)
- 462 # Cache result when required
- 463 if self.cache and self.parent is not None:
- 464 self.debug("Write to call cache: %s, %s, %r" % (self.name,
- Variables:
- i = <noc.sa.interfaces.igetswitchport.IGetSwitchport object at 0x804b0c550>
- self = <Script(script-172.18.244.56-DLink.DxS.get_switchport, started 34442094720)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 481)
- Function: run
- 474
- 475 def run(self):
- 476 """Script thread worker method"""
- 477 self.debug("Running")
- 478 result = None
- 479 try:
- 480 with self.cancelable():
- 481 ==> result = self.guarded_run()
- 482 except TimeOutError:
- 483 self.error("Timed out")
- 484 self.e_timeout = True
- 485 except CancelledError:
- 486 self.error("Cancelled")
- 487 self.e_cancel = True
- Variables:
- self = <Script(script-172.18.244.56-DLink.DxS.get_switchport, started 34442094720)>
- r = ["<type 'exceptions.IndexError'>", 'list index out of range']
- result = None
- v = IndexError('list index out of range',)
- tb = <traceback object at 0x805407878>
- t = <type 'exceptions.IndexError'>
- ------------------------------------------------------------------------
- END OF TRACEBACK
- Run again
Add Comment
Please, Sign In to add comment