Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------------------------------------------
- File: /opt/noc/lib64/python2.6/re.py (Line: 190)
- Function: compile
- 183 string. For each match, the iterator returns a match object.
- 184
- 185 Empty matches are included in the result."""
- 186 return _compile(pattern, flags).finditer(string)
- 187
- 188 def compile(pattern, flags=0):
- 189 "Compile a regular expression pattern, returning a pattern object."
- 190 ==> return _compile(pattern, flags)
- 191
- 192 def purge():
- 193 "Clear the regular expression cache"
- 194 _cache.clear()
- 195 _cache_repl.clear()
- 196
- Variables:
- pattern = '^\\s*(?P<line>\\d+)\\s+(?P<flags>[]+(?:\\s+[]+)*\\s+)?(?P<rest>.+)$'
- flags = 0
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/MikroTik/RouterOS/__init__.py (Line: 86)
- Function: parse_detail
- 79 elif ns:
- 80 ns[-1] += " %s" % l.strip()
- 81 # Parse
- 82 f = "".join(flags)
- 83 rx = re.compile(
- 84 r"^\s*(?P<line>\d+)\s+"
- 85 r"(?P<flags>[%s]+(?:\s+[%s]+)*\s+)?"
- 86 ==> r"(?P<rest>.+)$" % (f, f))
- 87 r = []
- 88 for l in ns:
- 89 match = rx.match(l)
- 90 if match:
- 91 n = int(match.group("line"))
- 92 f = match.group("flags")
- Variables:
- s = ''
- ns = []
- flags = []
- self = <noc.sa.profiles.MikroTik.RouterOS.Profile object at 0x7f683c0fd650>
- f = ''
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/MikroTik/RouterOS/__init__.py (Line: 49)
- Function: cli_detail
- 42 def cli_detail(self, script, cmd):
- 43 """
- 44 Parse RouterOS .... print detail output
- 45 :param script:
- 46 :param cmd:
- 47 :return:
- 48 """
- 49 ==> return self.parse_detail(script.cli(cmd))
- 50
- 51 rx_p_new = re.compile("^\s*(?P<line>\d+)\s+")
- 52 rx_key = re.compile("([a-zA-Z\-]+)=")
- 53
- 54 def parse_detail(self, s):
- 55 """
- Variables:
- self = <noc.sa.profiles.MikroTik.RouterOS.Profile object at 0x7f683c0fd650>
- cmd = '/interface print detail'
- script = <Script(Thread-1511, started 140085740185344)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/MikroTik/RouterOS/get_interfaces.py (Line: 27)
- Function: execute
- 20 "wlan": "physical",
- 21 "bridge": "SVI"
- 22 }
- 23
- 24 def execute(self):
- 25 ifaces = {}
- 26 # Fill interfaces
- 27 ==> for n, f, r in self.cli_detail("/interface print detail"):
- 28 ifaces[r["name"]] = {
- 29 "name": r["name"],
- 30 "type": self.type_map[r["type"]],
- 31 "admin_status": "X" not in f,
- 32 "oper_status": "R" in f,
- 33 "subinterfaces": []
- Variables:
- self = <Script(Thread-1511, started 140085740185344)>
- ifaces = {}
- ------------------------------------------------------------------------
- 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.igetinterfaces.IGetInterfaces object at 0x18e9910>
- self = <Script(Thread-1511, started 140085740185344)>
- ------------------------------------------------------------------------
- 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-1511, started 140085740185344)>
- r = ["<class 'sre_constants.error'>", 'unbalanced parenthesis']
- result = None
- v = error('unbalanced parenthesis',)
- tb = <traceback object at 0x7f683c12a998>
- t = <class 'sre_constants.error'>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment