Guest User

Untitled

a guest
Jul 2nd, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.70 KB | None | 0 0
  1. ------------------------------------------------------------------------
  2. File: /opt/noc/lib64/python2.6/re.py (Line: 190)
  3. Function: compile
  4. 183 string. For each match, the iterator returns a match object.
  5. 184
  6. 185 Empty matches are included in the result."""
  7. 186 return _compile(pattern, flags).finditer(string)
  8. 187
  9. 188 def compile(pattern, flags=0):
  10. 189 "Compile a regular expression pattern, returning a pattern object."
  11. 190 ==> return _compile(pattern, flags)
  12. 191
  13. 192 def purge():
  14. 193 "Clear the regular expression cache"
  15. 194 _cache.clear()
  16. 195 _cache_repl.clear()
  17. 196
  18. Variables:
  19. pattern = '^\\s*(?P<line>\\d+)\\s+(?P<flags>[]+(?:\\s+[]+)*\\s+)?(?P<rest>.+)$'
  20. flags = 0
  21. ------------------------------------------------------------------------
  22. File: /opt/noc/sa/profiles/MikroTik/RouterOS/__init__.py (Line: 86)
  23. Function: parse_detail
  24. 79 elif ns:
  25. 80 ns[-1] += " %s" % l.strip()
  26. 81 # Parse
  27. 82 f = "".join(flags)
  28. 83 rx = re.compile(
  29. 84 r"^\s*(?P<line>\d+)\s+"
  30. 85 r"(?P<flags>[%s]+(?:\s+[%s]+)*\s+)?"
  31. 86 ==> r"(?P<rest>.+)$" % (f, f))
  32. 87 r = []
  33. 88 for l in ns:
  34. 89 match = rx.match(l)
  35. 90 if match:
  36. 91 n = int(match.group("line"))
  37. 92 f = match.group("flags")
  38. Variables:
  39. s = ''
  40. ns = []
  41. flags = []
  42. self = <noc.sa.profiles.MikroTik.RouterOS.Profile object at 0x7f683c0fd650>
  43. f = ''
  44.  
  45.  
  46. ------------------------------------------------------------------------
  47. File: /opt/noc/sa/profiles/MikroTik/RouterOS/__init__.py (Line: 49)
  48. Function: cli_detail
  49. 42 def cli_detail(self, script, cmd):
  50. 43 """
  51. 44 Parse RouterOS .... print detail output
  52. 45 :param script:
  53. 46 :param cmd:
  54. 47 :return:
  55. 48 """
  56. 49 ==> return self.parse_detail(script.cli(cmd))
  57. 50
  58. 51 rx_p_new = re.compile("^\s*(?P<line>\d+)\s+")
  59. 52 rx_key = re.compile("([a-zA-Z\-]+)=")
  60. 53
  61. 54 def parse_detail(self, s):
  62. 55 """
  63. Variables:
  64. self = <noc.sa.profiles.MikroTik.RouterOS.Profile object at 0x7f683c0fd650>
  65. cmd = '/interface print detail'
  66. script = <Script(Thread-1511, started 140085740185344)>
  67. ------------------------------------------------------------------------
  68. File: /opt/noc/sa/profiles/MikroTik/RouterOS/get_interfaces.py (Line: 27)
  69. Function: execute
  70. 20 "wlan": "physical",
  71. 21 "bridge": "SVI"
  72. 22 }
  73. 23
  74. 24 def execute(self):
  75. 25 ifaces = {}
  76. 26 # Fill interfaces
  77. 27 ==> for n, f, r in self.cli_detail("/interface print detail"):
  78. 28 ifaces[r["name"]] = {
  79. 29 "name": r["name"],
  80. 30 "type": self.type_map[r["type"]],
  81. 31 "admin_status": "X" not in f,
  82. 32 "oper_status": "R" in f,
  83. 33 "subinterfaces": []
  84. Variables:
  85. self = <Script(Thread-1511, started 140085740185344)>
  86. ifaces = {}
  87.  
  88. ------------------------------------------------------------------------
  89. File: /opt/noc/sa/script/script.py (Line: 422)
  90. Function: guarded_run
  91. 415 return result
  92. 416 except KeyError:
  93. 417 self.debug("Not in call cache: %r, %r" % (self.name,
  94. 418 self.kwargs))
  95. 419 pass
  96. 420 # Calling script body
  97. 421 self._thread_id = thread.get_ident()
  98. 422 ==> result = self.execute(**self.kwargs)
  99. 423 # Enforce interface result checking
  100. 424 for i in self.implements:
  101. 425 result = i.script_clean_result(self.profile, result)
  102. 426 # Cache result when required
  103. 427 if self.cache and self.parent is not None:
  104. 428 self.debug("Write to call cache: %s, %s, %r" % (self.name,
  105. Variables:
  106. i = <noc.sa.interfaces.igetinterfaces.IGetInterfaces object at 0x18e9910>
  107. self = <Script(Thread-1511, started 140085740185344)>
  108. ------------------------------------------------------------------------
  109. File: /opt/noc/sa/script/script.py (Line: 445)
  110. Function: run
  111. 438
  112. 439 def run(self):
  113. 440 """Script thread worker method"""
  114. 441 self.debug("Running")
  115. 442 result = None
  116. 443 try:
  117. 444 with self.cancelable():
  118. 445 ==> result = self.guarded_run()
  119. 446 except self.TimeOutError:
  120. 447 self.error("Timed out")
  121. 448 self.e_timeout = True
  122. 449 except CancelledError:
  123. 450 self.error("Cancelled")
  124. 451 self.e_cancel = True
  125. Variables:
  126. self = <Script(Thread-1511, started 140085740185344)>
  127. r = ["<class 'sre_constants.error'>", 'unbalanced parenthesis']
  128. result = None
  129. v = error('unbalanced parenthesis',)
  130. tb = <traceback object at 0x7f683c12a998>
  131. t = <class 'sre_constants.error'>
  132. ------------------------------------------------------------------------
  133. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment