Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: SA
-
Labels:None
-
Difficulty:Medium
Description
Task failed: <type 'exceptions.ValueError'>
need more than 1 value to unpack
START OF TRACEBACK
------------------------------------------------------------------------
File: /opt/noc/sa/profiles/Cisco/IOS/get_portchannel.py (Line: 31)
Function: execute
24 return []
25 for l in s.splitlines():
26 pc, rest = l.split(" ", 1)
27 pc = pc[2:]
28 v = self.cli("show interfaces port-channel %s | i Members in this channel" % pc).strip()
29 if not v:
30 continue
31 ==> x, y = v.split(":", 1)
32 r += [{
33 "interface": "Po %s" % pc,
34 "members": y.strip().split(),
35 "type": "L", # <!> TODO: port-channel type detection
36 }]
37 return r
Variables:
self = <Script(script-xx.xx.xx.xx-Cisco.IOS.get_portchannel, initial)>
l = 'Po1 Aggr-proletarka notconnect 850 auto auto '
rest = ' Aggr-proletarka notconnect 850 auto auto '
pc = '1'
s = 'Po1 Aggr-proletarka notconnect 850 auto auto \n'
r = []
v = '$aces port-channel 1 | i Members in this channel'
------------------------------------------------------------------------
File: /opt/noc/sa/script/script.py (Line: 411)
Function: guarded_run
404 return result
405 except KeyError:
406 self.debug("Not in call cache: %r, %r" % (self.name,
407 self.kwargs))
408 pass
409 # Calling script body
410 self._thread_id = thread.get_ident()
411 ==> result = self.execute(**self.kwargs)
412 # Enforce interface result checking
413 for i in self.implements:
414 result = i.script_clean_result(self.profile, result)
415 # Cache result when required
416 if self.cache and self.parent is not None:
417 self.debug("Write to call cache: %s, %s, %r" % (self.name,
Variables:
i = <noc.sa.interfaces.igetportchannel.IGetPortchannel object at 0x804b26950>
self = <Script(script-xx.xx.xx.xx-Cisco.IOS.get_portchannel, initial)>
------------------------------------------------------------------------
File: /opt/noc/sa/script/script.py (Line: 81)
Function: _call_
74 self.script = script
75
76 def _call_(self, **kwargs):
77 """Call script"""
78 s = self.script(self.parent.profile, self.parent.activator,
79 self.parent.access_profile, parent=self.parent,
80 **kwargs)
81 ==> return s.guarded_run()
82
83
84 class ScriptRegistry(Registry):
85 """Script registry"""
86 name = "ScriptRegistry"
87 subdir = "profiles"
Variables:
s = <Script(script-xx.xx.xx.xx-Cisco.IOS.get_portchannel, initial)>
self = <noc.sa.script.script.ScriptCallProxy object at 0x805027d10>
kwargs = {}
------------------------------------------------------------------------
File: /opt/noc/sa/profiles/Cisco/IOS/get_interfaces.py (Line: 133)
Function: execute
126 vlans = self.cli(cmd)
127 except self.CLISyntaxError:
128 continue
129 if vlans:
130 pvm = self.map_vlans_to_ports(vlans)
131 # Get portchannels
132 portchannel_members = {}
133 ==> for pc in self.scripts.get_portchannel():
134 i = pc["interface"]
135 t = pc["type"] == "L"
136 for m in pc["members"]:
137 portchannel_members[m] = (i, t)
138 interfaces = []
139 subinterfaces = []
Variables:
vlans = '\nVLAN Name Status Ports\n---- -------------------------------- --------- -------------------------------\n1 default active Gi1/1, Gi1/2, Gi1/3, Gi1/4\n Gi1/5, Gi1/6, Gi1/7, Gi1/8\n Gi1/9, Gi1/10, Gi1/11, Gi1/12\n Gi1/13, Gi1/14, Gi1/15, Gi1/16\n Gi1/17, Gi1/18, Gi1/19, Gi1/20\n Gi1/21, Gi1/22, Gi1/25, Gi1/28\n46 Office active \n94 IP-input active \n121 ip_routing#2 active \n453 active \n500 IP-DSLAM-Control active \n703 Proletarka-IP active \n711 Karla-Marksa-7302 active \n726 7-Nebo-IP active \n730 PPPoE-B2B-bb active \n795 active \n821 Meschera-IP-7302 active \n850 Aggr-proletarka active Gi1/23, Gi1/24\n851 Aggr-proletarka-dlink active Te1/30\n1002 fddi-default act/unsup \n1003 token-ring-default act/unsup \n1004 fddinet-default act/unsup \n1005 trnet-default act/unsup \n2000 Voice-SS-bb active \n2023 Beeline-3g active \n2098 SladkayaZhizn-Esenina30 active \n2151 active \n2333 3G-bb active \n'
cmd = 'show vlan-switch brief'
pvm = {' ': ['46', '9', '4', '1', '2', '1', '4', '5', '3', '5', '0', '0', '7', '0', '3', '7', '1', '1', '7', '2', '6', '7', '3', '0', '7', '9', '5', '8', '2', '1', '2', '0', '0', '0', '2', '0', '2', '3', '2', '0', '9', '8', '2', '1', '5', '1', '2', '2', '2', '1', '2', '3', '3', '3'], 'Gi1/23': ['850'], 'Gi1/24': ['850'], 'Te1/30': ['851'], 'Gi1/4': ['1'], 'Gi1/1': ['1'], 'Gi1/3': ['1'], 'Gi1/2': ['1']}
portchannel_members = {}
self = <Script(script-xx.xx.xx.xx-Cisco.IOS.get_interfaces, started 34444466688)>
------------------------------------------------------------------------
File: /opt/noc/sa/script/script.py (Line: 411)
Function: guarded_run
404 return result
405 except KeyError:
406 self.debug("Not in call cache: %r, %r" % (self.name,
407 self.kwargs))
408 pass
409 # Calling script body
410 self._thread_id = thread.get_ident()
411 ==> result = self.execute(**self.kwargs)
412 # Enforce interface result checking
413 for i in self.implements:
414 result = i.script_clean_result(self.profile, result)
415 # Cache result when required
416 if self.cache and self.parent is not None:
417 self.debug("Write to call cache: %s, %s, %r" % (self.name,
Variables:
i = <noc.sa.interfaces.igetinterfaces.IGetInterfaces object at 0x804b26590>
self = <Script(script-92.242.92.39-Cisco.IOS.get_interfaces, started 34444466688)>
------------------------------------------------------------------------
File: /opt/noc/sa/script/script.py (Line: 434)
Function: run
427
428 def run(self):
429 """Script thread worker method"""
430 self.debug("Running")
431 result = None
432 try:
433 with self.cancelable():
434 ==> result = self.guarded_run()
435 except TimeOutError:
436 self.error("Timed out")
437 self.e_timeout = True
438 except CancelledError:
439 self.error("Cancelled")
440 self.e_cancel = True
Variables:
self = <Script(script-xx.xx.xx.xx-Cisco.IOS.get_interfaces, started 34444466688)>
r = ["<type 'exceptions.ValueError'>", 'need more than 1 value to unpack']
result = None
v = ValueError('need more than 1 value to unpack',)
tb = <traceback object at 0x8050339e0>
t = <type 'exceptions.ValueError'>
------------------------------------------------------------------------
END OF TRACEBACK
Покажи вывод команды "show interfaces port-channel 1"
P.S. лучше traceback форматировать как код. Чуть глаза не сломал.