Guest User

Untitled

a guest
Sep 19th, 2014
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.93 KB | None | 0 0
  1. UNHANDLED EXCEPTION (2014-09-19 22:52:48.739742)
  2. Working directory: /opt/noc
  3. <type 'exceptions.AttributeError'>
  4. 'StringParameter' object has no attribute '_clean'
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/inv/models/modelinterface.py (Line: 146)
  8. Function: clean_data
  9. 139 for i_name in d:
  10. 140 mi = ModelInterface.objects.filter(name=i_name).first()
  11. 141 if not mi:
  12. 142 raise ModelDataError("Unknown interface '%s'" % i_name)
  13. 143 v = d[i_name]
  14. 144 for a in mi.attrs:
  15. 145 if a.name in v:
  16. 146 ==> v[a.name] = T_MAP[a.type]._clean(v[a.name])
  17. 147 return d
  18. Variables:
  19. a = <ModelInterfaceAttr: part_no0>
  20. d = {'asset': {'part_no0': 'SFP-10G-LR'}}
  21. i_name = 'asset'
  22. mi = <ModelInterface: asset>
  23. v = {'part_no0': 'SFP-10G-LR'}
  24. data = {'asset': {'part_no0': 'SFP-10G-LR'}}
  25. cls = <class 'noc.inv.models.modelinterface.ModelInterface'>
  26. ------------------------------------------------------------------------
  27. File: /opt/noc/inv/apps/objectmodel/views.py (Line: 31)
  28. Function: clean
  29. 24 model = ObjectModel
  30. 25 parent_model = DocCategory
  31. 26 parent_field = "parent"
  32. 27 query_fields = ["name__icontains", "description__icontains"]
  33. 28
  34. 29 def clean(self, data):
  35. 30 if "data" in data:
  36. 31 ==> data["data"] = ModelInterface.clean_data(data["data"])
  37. 32 if "plugins" in data and data["plugins"]:
  38. 33 data["plugins"] = [x.strip() for x in data["plugins"].split(",") if x.strip()]
  39. 34 else:
  40. 35 data["plugins"] = None
  41. 36 return super(ObjectModelApplication, self).clean(data)
  42. 37
  43. Variables:
  44. self =
  45. <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x8107cb450>
  46. data =
  47. {'connection_rule': '',
  48. 'connections': [{'cross': None,
  49. 'description': 'XFP Connector',
  50. 'direction': 'o',
  51. 'gender': 'm',
  52. 'group': None,
  53. 'internal_name': None,
  54. 'name': 'in',
  55. 'protocols': ['TransEth10G'],
  56. 'type': '541302c6f3b6823b142ce596'},
  57. {'cross': None,
  58. 'description': 'RX Port',
  59. 'direction': 's',
  60. 'gender': 'f',
  61. 'group': None,
  62. 'internal_name': None,
  63. 'name': 'rx',
  64. 'protocols': ['>10GBASELR-1310'],
  65. 'type': '541302c6f3b6823b142ce5be'},
  66. {'cross': None,
  67. 'description': 'TX Port',
  68. 'direction': 's',
  69. 'gender': 'f',
  70. 'group': None,
  71. 'internal_name': None,
  72. 'name': 'tx',
  73. 'protocols': ['<10GBASELR-1310'],
  74. 'type': '541302c6f3b6823b142ce5be'}],
  75. 'cr_context': 'XCVR',
  76. 'data': {'asset': {'part_no0': 'SFP-10G-LR'}},
  77. 'description': 'Cisco SFP+ 10G LR transceiver',
  78. 'id': 'NOC.inv.objectmodel.Model-sm-3',
  79. 'name': 'Cisco | Transceiver | 10G | SFP-10G-LR',
  80. 'plugins': '',
  81. 'vendor': '541302c5f3b6823b142ce4ec'}
  82. ------------------------------------------------------------------------
  83. File: /opt/noc/lib/app/extdocapplication.py (Line: 254)
  84. Function: api_create
  85. 247 "success": True,
  86. 248 "data": data
  87. 249 }
  88. 250
  89. 251 @view(method=["POST"], url="^$", access="create", api=True)
  90. 252 def api_create(self, request):
  91. 253 try:
  92. 254 ==> attrs = self.clean(self.deserialize(request.raw_post_data))
  93. 255 except ValueError, why:
  94. 256 return self.response(str(why), status=self.BAD_REQUEST)
  95. 257 if self.pk in attrs:
  96. 258 del attrs[self.pk]
  97. 259 if self.has_uuid and not attrs.get("uuid"):
  98. 260 attrs["uuid"] = uuid.uuid4()
  99. Variables:
  100. self =
  101. <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x8107cb450>
  102. request =
  103. <WSGIRequest
  104. path:/inv/objectmodel/,
  105. GET:<QueryDict: {}>,
  106. POST:<QueryDict: {u'{"name":"Cisco | Transceiver | 10G | SFP-10G-LR","description":"Cisco SFP 10G LR transceiver","vendor":"541302c5f3b6823b142ce4ec","connection_rule":"","cr_context":"XCVR","plugins":"","data":{"asset":{"part_no0":"SFP-10G-LR"}},"connections":[{"name":"in","type":"541302c6f3b6823b142ce596","group":null,"direction":"o","gender":"m","cross":null,"protocols":["TransEth10G"],"internal_name":null,"description":"XFP Connector"},{"name":"rx","type":"541302c6f3b6823b142ce5be","group":null,"direction":"s","gender":"f","cross":null,"protocols":[">10GBASELR-1310"],"internal_name":null,"description":"RX Port"},{"name":"tx","type":"541302c6f3b6823b142ce5be","group":null,"direction":"s","gender":"f","cross":null,"protocols":["<10GBASELR-1310"],"internal_name":null,"description":"TX Port"}],"id":"NOC.inv.objectmodel.Model-sm-3"}': [u'']}>,
  107. COOKIES:{'csrftoken': '102bc6e214b4272a803d0c0a1dd106aa',
  108. 'sessionid': '90d47410a23e91785ef6af075735626c'},
  109. META:{'CONTENT_LENGTH': '824',
  110. 'CONTENT_TYPE': 'application/json; charset=UTF-8',
  111. 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  112. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  113. 'HTTP_ACCEPT_LANGUAGE': 'ru,en-us;q=0.7,en;q=0.3',
  114. 'HTTP_CACHE_CONTROL': 'no-cache',
  115. 'HTTP_CONNECTION': 'close',
  116. 'HTTP_COOKIE': 'csrftoken=102bc6e214b4272a803d0c0a1dd106aa; sessionid=90d47410a23e91785ef6af075735626c',
  117. 'HTTP_DNT': '1',
  118. 'HTTP_HOST': '127.0.0.1:8000',
  119. 'HTTP_PRAGMA': 'no-cache',
  120. 'HTTP_REFERER': 'http://noc/main/desktop/',
  121. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0',
  122. 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
  123. 'PATH_INFO': u'/inv/objectmodel/',
  124. 'QUERY_STRING': '',
  125. 'REMOTE_ADDR': '127.0.0.1',
  126. 'REQUEST_METHOD': 'POST',
  127. 'SCRIPT_NAME': u'',
  128. 'SERVER_NAME': '127.0.0.1',
  129. 'SERVER_PORT': '8000',
  130. 'SERVER_PROTOCOL': 'HTTP/1.0',
  131. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x8079484b0>,
  132. 'wsgi.input': <_io.BytesIO object at 0x8132f0110>,
  133. 'wsgi.multiprocess': True,
  134. 'wsgi.multithread': False,
  135. 'wsgi.run_once': False,
  136. 'wsgi.url_scheme': 'http',
  137. 'wsgi.version': (1, 0)}>
  138. ------------------------------------------------------------------------
  139. File: /opt/noc/lib/app/site.py (Line: 246)
  140. Function: inner
  141. 239 for k, v in request.POST.lists())
  142. 240 elif request.method == "GET":
  143. 241 a = dict((k, v[0] if len(v) == 1 else v)
  144. 242 for k, v in request.GET.lists())
  145. 243 app_logger.debug("API %s %s %s",
  146. 244 request.method, request.path, a)
  147. 245 # Call handler
  148. 246 ==> r = v(request, *args, **kwargs)
  149. 247 # Dump SQL statements
  150. 248 if self.log_sql_statements:
  151. 249 from django.db import connections
  152. 250 tsc = 0
  153. 251 sc = defaultdict(int)
  154. 252 for conn in connections.all():
  155. Variables:
  156. args = ()
  157. view_map =
  158. {'GET': <bound method ObjectModelApplication.api_list of <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x8107cb450>>,
  159. 'POST': <bound method ObjectModelApplication.api_create of <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x8107cb450>>}
  160. Form = <class 'django.forms.forms.Form'>
  161. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  162. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  163. self = <noc.lib.app.site.Site object at 0x80d44b150>
  164. v =
  165. <bound method ObjectModelApplication.api_create of <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x8107cb450>>
  166. request =
  167. <WSGIRequest
  168. path:/inv/objectmodel/,
  169. GET:<QueryDict: {}>,
  170. POST:<QueryDict: {u'{"name":"Cisco | Transceiver | 10G | SFP-10G-LR","description":"Cisco SFP 10G LR transceiver","vendor":"541302c5f3b6823b142ce4ec","connection_rule":"","cr_context":"XCVR","plugins":"","data":{"asset":{"part_no0":"SFP-10G-LR"}},"connections":[{"name":"in","type":"541302c6f3b6823b142ce596","group":null,"direction":"o","gender":"m","cross":null,"protocols":["TransEth10G"],"internal_name":null,"description":"XFP Connector"},{"name":"rx","type":"541302c6f3b6823b142ce5be","group":null,"direction":"s","gender":"f","cross":null,"protocols":[">10GBASELR-1310"],"internal_name":null,"description":"RX Port"},{"name":"tx","type":"541302c6f3b6823b142ce5be","group":null,"direction":"s","gender":"f","cross":null,"protocols":["<10GBASELR-1310"],"internal_name":null,"description":"TX Port"}],"id":"NOC.inv.objectmodel.Model-sm-3"}': [u'']}>,
  171. COOKIES:{'csrftoken': '102bc6e214b4272a803d0c0a1dd106aa',
  172. 'sessionid': '90d47410a23e91785ef6af075735626c'},
  173. META:{'CONTENT_LENGTH': '824',
  174. 'CONTENT_TYPE': 'application/json; charset=UTF-8',
  175. 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  176. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  177. 'HTTP_ACCEPT_LANGUAGE': 'ru,en-us;q=0.7,en;q=0.3',
  178. 'HTTP_CACHE_CONTROL': 'no-cache',
  179. 'HTTP_CONNECTION': 'close',
  180. 'HTTP_COOKIE': 'csrftoken=102bc6e214b4272a803d0c0a1dd106aa; sessionid=90d47410a23e91785ef6af075735626c',
  181. 'HTTP_DNT': '1',
  182. 'HTTP_HOST': '127.0.0.1:8000',
  183. 'HTTP_PRAGMA': 'no-cache',
  184. 'HTTP_REFERER': 'http://noc/main/desktop/',
  185. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0',
  186. 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
  187. 'PATH_INFO': u'/inv/objectmodel/',
  188. 'QUERY_STRING': '',
  189. 'REMOTE_ADDR': '127.0.0.1',
  190. 'REQUEST_METHOD': 'POST',
  191. 'SCRIPT_NAME': u'',
  192. 'SERVER_NAME': '127.0.0.1',
  193. 'SERVER_PORT': '8000',
  194. 'SERVER_PROTOCOL': 'HTTP/1.0',
  195. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x8079484b0>,
  196. 'wsgi.input': <_io.BytesIO object at 0x8132f0110>,
  197. 'wsgi.multiprocess': True,
  198. 'wsgi.multithread': False,
  199. 'wsgi.run_once': False,
  200. 'wsgi.url_scheme': 'http',
  201. 'wsgi.version': (1, 0)}>
  202. app_logger = <logging.Logger object at 0x8107cb890>
  203. InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  204. to_log_api_call = False
  205. kwargs = {}
  206. nq = <function nq at 0x8134e05f0>
  207. app =
  208. <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x8107cb450>
  209. ------------------------------------------------------------------------
  210. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment