Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def execute(self, changed_prefix_lists):
- actions = []
- result = []
- for l in changed_prefix_lists:
- name = l["name"]
- prefixes = l["prefix_list"]
- ...
- prefix_set_new = set(self.profile.generate_prefix_list(name, prefixes).splitlines())
- ...
- <type 'exceptions.ValueError'>
- too many values to unpack
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/Cisco/IOSXR/__init__.py (Line: 55)
- Function: generate_prefix_list
- 48 def generate_prefix_list(self, name, pl):
- 49 """
- 50 Generate prefix list _name_. pl is a list of (prefix, min_len, max_len)
- 51 """
- 52 me = " %s"
- 53 mne = " %s le %d"
- 54 r = []
- 55 ==> for prefix, min_len, max_len in pl:
- 56 if min_len == max_len:
- 57 r += [me % prefix]
- 58 else:
- 59 r += [mne % (prefix, max_len)]
- 60 return "\n".join([
- 61 "prefix-set %s" % name,
- Variables:
- me = ' %s'
- name = 'AS15370'
- self = <noc.sa.profiles.Cisco.IOSXR.Profile object at 0x80ef8aa10>
- r = []
- mne = ' %s le %d'
- pl = ['192.168.1.0/24']
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/Cisco/IOSXR/sync_prefix_lists.py (Line: 36)
- Function: execute
- 29 continue
- 30
- 31 # Retrieve prefix list
- 32 pl = self.cli("show rpl prefix-set %s" % name)
- 33 prefix_set_appl = '\n'.join(pl.split('\n')[1:-2]).split(',\n')
- 34
- 35 # Build new prefix-list
- 36 ==> prefix_set_new = set(self.profile.generate_prefix_list(name, prefixes).splitlines())
- 37
- 38 # if prefix-set doesnt exist, create them
- 39 if pl.strip() == "The prefix-set (%s) does not appear to exist\n\n" % name:
- 40 prefix_set_new.add(["commit"])
- 41 result += [{"name": name, "status": True}]
- 42 # with self.configure():
- Variables:
- name = 'AS15370'
- self = <Script(Thread-2, started 34611479552)>
- l = {'strict': False, 'prefix_list': ['192.168.1.0/24'], 'name': 'AS15370'}
- actions = []
- changed_prefix_lists =
- [{'name': 'AS15370', 'prefix_list': ['192.168.1.0/24'], 'strict': False}]
- prefixes = ['192.168.1.0/24']
- result = []
- prefix_set_appl = [' 192.162.88.0/22\nend-set']
- pl = 'prefix-set AS15370\n 192.162.88.0/22\nend-set\n!\n'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 422)
- Function: guarded_run
- 415 return result
- 416 except KeyError:
- 417 self.debug("Not in call cache: %r, %r" % (self.name,
- 418 self.kwargs))
- 419 pass
- 420 # Calling script body
- 421 self._thread_id = thread.get_ident()
- 422 ==> result = self.execute(**self.kwargs)
- 423 # Enforce interface result checking
- 424 for i in self.implements:
- 425 result = i.script_clean_result(self.profile, result)
- 426 # Cache result when required
- 427 if self.cache and self.parent is not None:
- 428 self.debug("Write to call cache: %s, %s, %r" % (self.name,
- Variables:
- i =
- <noc.sa.interfaces.isyncprefixlists.ISyncPrefixLists object at 0x80d214490>
- self = <Script(Thread-2, started 34611479552)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 445)
- Function: run
- 438
- 439 def run(self):
- 440 """Script thread worker method"""
- 441 self.debug("Running")
- 442 result = None
- 443 try:
- 444 with self.cancelable():
- 445 ==> result = self.guarded_run()
- 446 except self.TimeOutError:
- 447 self.error("Timed out")
- 448 self.e_timeout = True
- 449 except CancelledError:
- 450 self.error("Cancelled")
- 451 self.e_cancel = True
- Variables:
- self = <Script(Thread-2, started 34611479552)>
- r = ["<type 'exceptions.ValueError'>", 'too many values to unpack']
- result = None
- v = ValueError('too many values to unpack',)
- tb = <traceback object at 0x80ef94e18>
- t = <type 'exceptions.ValueError'>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement