Advertisement
Izya12

Untitled

Mar 16th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.15 KB | None | 0 0
  1. PROCESS: ./commands/script.py
  2. VERSION: 15.05.1+microservices.9141.4c85fb66
  3. BRANCH: microservices CHANGESET: 4c85fb66
  4. ERROR FINGERPRINT: e22a6b9a-21a6-5f94-b2eb-c109c4bc8ae5
  5. WORKING DIRECTORY: /opt/noc
  6. EXCEPTION: <type 'exceptions.AttributeError'> 'NoneType' object has no attribute 'endswith'
  7. START OF TRACEBACK
  8. ------------------------------------------------------------------------
  9. File: sa/profiles/MikroTik/RouterOS/__init__.py (Line: 43)
  10. Function: setup_script
  11. 36 Starting from v3.14 we can specify console options
  12. 37 during login process
  13. 38 :param script:
  14. 39 :return:
  15. 40 """
  16. 41 if script.parent is None:
  17. 42 user = script.credentials.get("user", "")
  18. 43 ==> if not user.endswith("+ct255w255h"):
  19. 44 script.credentials["user"] = user + "+ct255w255h"
  20. 45 self.add_script_method(script, "cli_detail", self.cli_detail)
  21. 46
  22. 47 def setup_session(self, script):
  23. 48 # MikroTik Remove duplicates prompt
  24. 49 script.cli("\n")
  25. Variables:
  26. self = <noc.sa.profiles.MikroTik.RouterOS.Profile object at 0x7fb749274050>
  27. user = None
  28. script =
  29. <noc.sa.profiles.MikroTik.RouterOS.get_config.Script object at 0x7fb749274310>
  30. ------------------------------------------------------------------------
  31. File: core/script/base.py (Line: 186)
  32. Function: __init__
  33. 179 version
  34. 180 )
  35. 181 # Fill matchers
  36. 182 if not self.name.endswith(".get_version"):
  37. 183 self.apply_matchers()
  38. 184 #
  39. 185 if self.profile.setup_script:
  40. 186 ==> self.profile.setup_script(self)
  41. 187
  42. 188 def __call__(self, *args, **kwargs):
  43. 189 self.args = kwargs
  44. 190 return self.run()
  45. 191
  46. 192 def apply_matchers(self):
  47. Variables:
  48. service = <__main__.ServiceStub object at 0x7fb749258f10>
  49. version =
  50. {'platform': u'RB2011UiAS-2HnD', 'vendor': u'MikroTik', 'version': u'6.40.5'}
  51. args = {}
  52. name = u'MikroTik.RouterOS.get_config'
  53. parent = None
  54. self =
  55. <noc.sa.profiles.MikroTik.RouterOS.get_config.Script object at 0x7fb749274310>
  56. collect_beef = False
  57. capabilities = {}
  58. s = [u'MikroTik', u'RouterOS', u'get_config']
  59. session = None
  60. session_idle_timeout = None
  61. timeout = 3600
  62. credentials =
  63. {'access_preference': u'C',
  64. 'address': u'xxx.xxx.16.1',
  65. 'cli_protocol': 'telnet',
  66. 'password': None,
  67. 'path': None,
  68. 'raise_privileges': True,
  69. 'snmp_ro': u'xxxxx',
  70. 'snmp_version': 'v2c',
  71. 'super_password': None,
  72. 'user': None}
  73. ------------------------------------------------------------------------
  74. File: commands/script.py (Line: 116)
  75. Function: handle
  76. 109 service=service,
  77. 110 credentials=credentials,
  78. 111 capabilities=caps,
  79. 112 args=args,
  80. 113 version=version,
  81. 114 timeout=3600,
  82. 115 name=script,
  83. 116 ==> collect_beef=bool(beef)
  84. 117 )
  85. 118 result = scr.run()
  86. 119 if pretty:
  87. 120 pprint.pprint(result)
  88. 121 elif yaml:
  89. 122 import yaml
  90. Variables:
  91. obj = <ManagedObject: MikroTik_KUUG>
  92. beef = None
  93. service = <__main__.ServiceStub object at 0x7fb749258f10>
  94. script = u'MikroTik.RouterOS.get_config'
  95. script_class = <class 'noc.sa.profiles.MikroTik.RouterOS.get_config.Script'>
  96. self = <__main__.Command object at 0x7fb755be5b50>
  97. args = {}
  98. use_snmp = True
  99. caps = {}
  100. yaml = False
  101. object_name = ['MikroTik_KUUG']
  102. version =
  103. {'platform': u'RB2011UiAS-2HnD', 'vendor': u'MikroTik', 'version': u'6.40.5'}
  104. arguments = []
  105. pretty = True
  106. credentials =
  107. {'access_preference': u'C',
  108. 'address': u'xxx.xxx.16.1',
  109. 'cli_protocol': 'telnet',
  110. 'password': None,
  111. 'path': None,
  112. 'raise_privileges': True,
  113. 'snmp_ro': u'xxxxx',
  114. 'snmp_version': 'v2c',
  115. 'super_password': None,
  116. 'user': None}
  117. options = {}
  118. access_preference = None
  119. ------------------------------------------------------------------------
  120. File: core/management/base.py (Line: 75)
  121. Function: run_from_argv
  122. 68 enable_profiling = cmd_options.pop("enable_profiling", False)
  123. 69 show_metrics = cmd_options.pop("show_metrics", False)
  124. 70 if enable_profiling:
  125. 71 # Start profiler
  126. 72 import yappi
  127. 73 yappi.start()
  128. 74 try:
  129. 75 ==> return self.handle(*args, **cmd_options) or 0
  130. 76 except CommandError as e:
  131. 77 self.print(str(e))
  132. 78 return 1
  133. 79 except KeyboardInterrupt:
  134. 80 self.print("Ctrl+C")
  135. 81 return 3
  136. Variables:
  137. parser =
  138. ArgumentParser(prog='script.py', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
  139. loglevel = 'debug'
  140. enable_profiling = False
  141. args = ()
  142. cmd_options =
  143. {'access_preference': None,
  144. 'arguments': [],
  145. 'beef': None,
  146. 'object_name': ['MikroTik_KUUG'],
  147. 'pretty': True,
  148. 'script': ['get_config'],
  149. 'use_snmp': True,
  150. 'yaml': False}
  151. argv = ['--debug', '--pretty', 'get_config', 'MikroTik_KUUG']
  152. self = <__main__.Command object at 0x7fb755be5b50>
  153. show_metrics = False
  154. options =
  155. Namespace(access_preference=None, arguments=[], beef=None, object_name=['MikroTik_KUUG'], pretty=True, script=['get_config'], use_snmp=True, yaml=False)
  156. ------------------------------------------------------------------------
  157. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement