Advertisement
Guest User

Untitled

a guest
Nov 20th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.77 KB | None | 0 0
  1. UNHANDLED EXCEPTION (2013-11-20 23:02:03.691732)
  2. Working directory: /opt/noc
  3. <class 'mongoengine.base.ValidationError'>
  4. Unable to dereference <class 'noc.inv.models.objectmodel.ObjectModel'>:528c77e7f3b68213faf03d45
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/lib/nosql.py (Line: 103)
  8. Function: __get__
  9. 96 # Dereference DBRefs
  10. 97 if isinstance(value, ObjectId):
  11. 98 v = self.document_type.objects(id=value).first()
  12. 99 if v is not None:
  13. 100 instance._data[self.name] = v
  14. 101 else:
  15. 102 raise ValidationError("Unable to dereference %s:%s" % (
  16. 103 ==> self.document_type, value))
  17. 104 return super(PlainReferenceField, self).__get__(instance, owner)
  18. 105
  19. 106 def to_mongo(self, document):
  20. 107 if isinstance(document, Document):
  21. 108 # We need the id from the saved object to create the DBRef
  22. 109 id_ = document.id
  23. Variables:
  24. owner = <class 'noc.inv.models.object.Object'>
  25. instance = <Object: 528c785ef3b682169aeb26c2>
  26. self = <noc.lib.nosql.PlainReferenceField object at 0x80d74dc90>
  27. value = ObjectId('528c77e7f3b68213faf03d45')
  28. v = None
  29. ------------------------------------------------------------------------
  30. File: /opt/noc/sa/apps/managedobject/views.py (Line: 478)
  31. Function: get_nested_inventory
  32. 471 self.discovery_scheduler = DiscoveryScheduler()
  33. 472 self.discovery_scheduler.ensure_job(job_name, managed_object)
  34. 473
  35. 474 def get_nested_inventory(self, o):
  36. 475 r = {
  37. 476 "id": str(o.id),
  38. 477 "serial": o.get_data("asset", "serial"),
  39. 478 ==> "description": o.model.description,
  40. 479 "model": o.model.name
  41. 480 }
  42. 481 children = []
  43. 482 for n in o.model.connections:
  44. 483 if n.direction == "i":
  45. 484 c, r_object, _ = o.get_p2p_connection(n.name)
  46. Variables:
  47. self =
  48. <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>
  49. o = <Object: 528c785ef3b682169aeb26c2>
  50. ------------------------------------------------------------------------
  51. File: /opt/noc/sa/apps/managedobject/views.py (Line: 495)
  52. Function: get_nested_inventory
  53. 488 "name": n.name,
  54. 489 "leaf": True,
  55. 490 "serial": None,
  56. 491 "description": "--- EMPTY ---",
  57. 492 "model": None
  58. 493 }]
  59. 494 else:
  60. 495 ==> cc = self.get_nested_inventory(r_object)
  61. 496 cc["name"] = n.name
  62. 497 children += [cc]
  63. 498 elif n.direction == "s":
  64. 499 children += [{
  65. 500 "id": None,
  66. 501 "name": n.name,
  67. Variables:
  68. c =
  69. <ObjectConnection: <528c785ef3b682169aeb26c2: in, 52851677f3b6822d9c1cda8f: Te29_x2>>
  70. cc =
  71. {'children': [{'description': u'TX Port',
  72. 'id': None,
  73. 'leaf': True,
  74. 'model': u'1000BASETX',
  75. 'name': u'port',
  76. 'serial': None}],
  77. 'description': u'Cisco-compatible SFP T transceiver',
  78. 'expanded': False,
  79. 'id': '528bb1e3f3b6820410d11c76',
  80. 'model': u'Avago | Transceiver | 1G | SFP T',
  81. 'name': u'Gi28_sfp',
  82. 'serial': u'AGM123521TU'}
  83. self =
  84. <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>
  85. o = <Object: 52851677f3b6822d9c1cda8f>
  86. n = <ObjectModelConnection: Te29_x2>
  87. r_object = <Object: 528c785ef3b682169aeb26c2>
  88. r =
  89. {'description': u'Cisco ME4924-10GE Layer-3 ethernet aggregation switch',
  90. 'id': '52851677f3b6822d9c1cda8f',
  91. 'model': u'Cisco | 4500 | ME-4924-10GE',
  92. 'serial': u'FOX1216GWCL'}
  93. children =
  94. [{'description': u'Console port',
  95. 'id': None,
  96. 'leaf': True,
  97. 'model': u'>RS232',
  98. 'name': u'Console',
  99. 'serial': None},
  100. {'description': u'FastEthernet management port',
  101. 'id': None,
  102. 'leaf': True,
  103. 'model': u'10BASET, 100BASETX',
  104. 'name': u'Fa0',
  105. 'serial': None},
  106. {'children': [{'description': u'RX Port',
  107. 'id': None,
  108. 'leaf': True,
  109. 'model': u'>1000BASELX-1310',
  110. 'name': u'rx',
  111. 'serial': None},
  112. {'description': u'TX Port',
  113. 'id': None,
  114. 'leaf': True,
  115. 'model': u'<1000BASELX-1310',
  116. 'name': u'tx',
  117. 'serial': None}],
  118. 'description': u'LH/LX transceiver without DOM support',
  119. 'expanded': False,
  120. 'id': '528bb1e3f3b6820410d11c6f',
  121. 'model': u'Avago | Transceiver | 1G | SFP LH',
  122. 'name': u'Gi1_sfp',
  123. 'serial': u'AGC1526UPRV'},
  124. {'children': [{'description': u'RX Port',
  125. 'id': None,
  126. 'leaf': True,
  127. 'model': u'>1000BASELX-1310',
  128. 'name': u'rx',
  129. 'serial': None},
  130. {'description': u'TX Port',
  131. 'id': None,
  132. 'leaf': True,
  133. 'model': u'<1000BASELX-1310',
  134. 'name': u'tx',
  135. 'serial': None}],
  136. 'description': u'NoName SFP LH transceiver',
  137. 'expanded': False,
  138. 'id': '528cb1b2f3b6821fee4bb0e6',
  139. 'model': u'NoName | Transceiver | 1G | SFP LH',
  140. 'name': u'Gi2_sfp',
  141. 'serial': u'H11L432'},
  142. {'children': [{'description': u'RX Port',
  143. 'id': None,
  144. 'leaf': True,
  145. 'model': u'>1000BASELX-1310',
  146. 'name': u'rx',
  147. 'serial': None},
  148. {'description': u'TX Port',
  149. 'id': None,
  150. 'leaf': True,
  151. 'model': u'<1000BASELX-1310',
  152. 'name': u'tx',
  153. 'serial': None}],
  154. 'description': u'LH/LX transceiver without DOM support',
  155. 'expanded': False,
  156. 'id': '528bb1e3f3b6820410d11c70',
  157. 'model': u'Finisar | Transceiver | 1G | SFP LH',
  158. 'name': u'Gi3_sfp',
  159. 'serial': u'FNS0838K0WZ'},
  160. {'description': '--- EMPTY ---',
  161. 'id': None,
  162. 'leaf': True,
  163. 'model': None,
  164. 'name': u'Gi4_sfp',
  165. 'serial': None},
  166. {'description': '--- EMPTY ---',
  167. 'id': None,
  168. 'leaf': True,
  169. 'model': None,
  170. 'name': u'Gi5_sfp',
  171. 'serial': None},
  172. {'description': '--- EMPTY ---',
  173. 'id': None,
  174. 'leaf': True,
  175. 'model': None,
  176. 'name': u'Gi6_sfp',
  177. 'serial': None},
  178. {'description': '--- EMPTY ---',
  179. 'id': None,
  180. 'leaf': True,
  181. 'model': None,
  182. 'name': u'Gi7_sfp',
  183. 'serial': None},
  184. {'description': '--- EMPTY ---',
  185. 'id': None,
  186. 'leaf': True,
  187. 'model': None,
  188. 'name': u'Gi8_sfp',
  189. 'serial': None},
  190. {'description': '--- EMPTY ---',
  191. 'id': None,
  192. 'leaf': True,
  193. 'model': None,
  194. 'name': u'Gi9_sfp',
  195. 'serial': None},
  196. {'description': '--- EMPTY ---',
  197. 'id': None,
  198. 'leaf': True,
  199. 'model': None,
  200. 'name': u'Gi10_sfp',
  201. 'serial': None},
  202. {'description': '--- EMPTY ---',
  203. 'id': None,
  204. 'leaf': True,
  205. 'model': None,
  206. 'name': u'Gi11_sfp',
  207. 'serial': None},
  208. {'description': '--- EMPTY ---',
  209. 'id': None,
  210. 'leaf': True,
  211. 'model': None,
  212. 'name': u'Gi12_sfp',
  213. 'serial': None},
  214. {'description': '--- EMPTY ---',
  215. 'id': None,
  216. 'leaf': True,
  217. 'model': None,
  218. 'name': u'Gi13_sfp',
  219. 'serial': None},
  220. {'description': '--- EMPTY ---',
  221. 'id': None,
  222. 'leaf': True,
  223. 'model': None,
  224. 'name': u'Gi14_sfp',
  225. 'serial': None},
  226. {'description': '--- EMPTY ---',
  227. 'id': None,
  228. 'leaf': True,
  229. 'model': None,
  230. 'name': u'Gi15_sfp',
  231. 'serial': None},
  232. {'children': [{'description': u'RX Port',
  233. 'id': None,
  234. 'leaf': True,
  235. 'model': u'>1000BASELX-1310',
  236. 'name': u'rx',
  237. 'serial': None},
  238. {'description': u'TX Port',
  239. 'id': None,
  240. 'leaf': True,
  241. 'model': u'<1000BASELX-1310',
  242. 'name': u'tx',
  243. 'serial': None}],
  244. 'description': u'LH/LX transceiver without DOM support',
  245. 'expanded': False,
  246. 'id': '528bb1e3f3b6820410d11c71',
  247. 'model': u'Finisar | Transceiver | 1G | SFP LH',
  248. 'name': u'Gi16_sfp',
  249. 'serial': u'FNS164617AE'},
  250. {'children': [{'description': u'RX Port',
  251. 'id': None,
  252. 'leaf': True,
  253. 'model': u'>1000BASELX-1310',
  254. 'name': u'rx',
  255. 'serial': None},
  256. {'description': u'TX Port',
  257. 'id': None,
  258. 'leaf': True,
  259. 'model': u'<1000BASELX-1310',
  260. 'name': u'tx',
  261. 'serial': None}],
  262. 'description': u'LH/LX transceiver without DOM support',
  263. 'expanded': False,
  264. 'id': '528bb1e3f3b6820410d11c72',
  265. 'model': u'Avago | Transceiver | 1G | SFP LH',
  266. 'name': u'Gi17_sfp',
  267. 'serial': u'AGC1527UNTS'},
  268. {'children': [{'description': u'RX Port',
  269. 'id': None,
  270. 'leaf': True,
  271. 'model': u'>1000BASELX-1310',
  272. 'name': u'rx',
  273. 'serial': None},
  274. {'description': u'TX Port',
  275. 'id': None,
  276. 'leaf': True,
  277. 'model': u'<1000BASELX-1310',
  278. 'name': u'tx',
  279. 'serial': None}],
  280. 'description': u'LH/LX transceiver without DOM support',
  281. 'expanded': False,
  282. 'id': '528bb1e3f3b6820410d11c73',
  283. 'model': u'Finisar | Transceiver | 1G | SFP LH',
  284. 'name': u'Gi18_sfp',
  285. 'serial': u'FNS16460D46'},
  286. {'children': [{'description': u'RX Port',
  287. 'id': None,
  288. 'leaf': True,
  289. 'model': u'>1000BASELX-1310',
  290. 'name': u'rx',
  291. 'serial': None},
  292. {'description': u'TX Port',
  293. 'id': None,
  294. 'leaf': True,
  295. 'model': u'<1000BASELX-1310',
  296. 'name': u'tx',
  297. 'serial': None}],
  298. 'description': u'NoName SFP LH transceiver',
  299. 'expanded': False,
  300. 'id': '528cb1b2f3b6821fee4bb0e8',
  301. 'model': u'NoName | Transceiver | 1G | SFP LH',
  302. 'name': u'Gi19_sfp',
  303. 'serial': u'H22L019'},
  304. {'children': [{'description': u'RX Port',
  305. 'id': None,
  306. 'leaf': True,
  307. 'model': u'>1000BASELX-1310',
  308. 'name': u'rx',
  309. 'serial': None},
  310. {'description': u'TX Port',
  311. 'id': None,
  312. 'leaf': True,
  313. 'model': u'<1000BASELX-1310',
  314. 'name': u'tx',
  315. 'serial': None}],
  316. 'description': u'NoName SFP LH transceiver',
  317. 'expanded': False,
  318. 'id': '528cb1b2f3b6821fee4bb0ea',
  319. 'model': u'NoName | Transceiver | 1G | SFP LH',
  320. 'name': u'Gi20_sfp',
  321. 'serial': u'H22L015'},
  322. {'children': [{'description': u'RX Port',
  323. 'id': None,
  324. 'leaf': True,
  325. 'model': u'>1000BASELX-1310',
  326. 'name': u'rx',
  327. 'serial': None},
  328. {'description': u'TX Port',
  329. 'id': None,
  330. 'leaf': True,
  331. 'model': u'<1000BASELX-1310',
  332. 'name': u'tx',
  333. 'serial': None}],
  334. 'description': u'LH/LX transceiver without DOM support',
  335. 'expanded': False,
  336. 'id': '528bb1e3f3b6820410d11c74',
  337. 'model': u'Avago | Transceiver | 1G | SFP LH',
  338. 'name': u'Gi21_sfp',
  339. 'serial': u'AGC1527UNUW'},
  340. {'children': [{'description': u'RX Port',
  341. 'id': None,
  342. 'leaf': True,
  343. 'model': u'>1000BASELX-1310',
  344. 'name': u'rx',
  345. 'serial': None},
  346. {'description': u'TX Port',
  347. 'id': None,
  348. 'leaf': True,
  349. 'model': u'<1000BASELX-1310',
  350. 'name': u'tx',
  351. 'serial': None}],
  352. 'description': u'LH/LX transceiver without DOM support',
  353. 'expanded': False,
  354. 'id': '528bb1e3f3b6820410d11c75',
  355. 'model': u'Avago | Transceiver | 1G | SFP LH',
  356. 'name': u'Gi22_sfp',
  357. 'serial': u'AGC1512UNB4'},
  358. {'description': '--- EMPTY ---',
  359. 'id': None,
  360. 'leaf': True,
  361. 'model': None,
  362. 'name': u'Gi23_sfp',
  363. 'serial': None},
  364. {'description': '--- EMPTY ---',
  365. 'id': None,
  366. 'leaf': True,
  367. 'model': None,
  368. 'name': u'Gi24_sfp',
  369. 'serial': None},
  370. {'children': [{'description': u'RX Port',
  371. 'id': None,
  372. 'leaf': True,
  373. 'model': u'>1000BASELX-1310',
  374. 'name': u'rx',
  375. 'serial': None},
  376. {'description': u'TX Port',
  377. 'id': None,
  378. 'leaf': True,
  379. 'model': u'<1000BASELX-1310',
  380. 'name': u'tx',
  381. 'serial': None}],
  382. 'description': u'NoName SFP LH transceiver',
  383. 'expanded': False,
  384. 'id': '528cb1b2f3b6821fee4bb0ec',
  385. 'model': u'NoName | Transceiver | 1G | SFP LH',
  386. 'name': u'Gi25_sfp',
  387. 'serial': u'H11L456'},
  388. {'children': [{'description': u'RX Port',
  389. 'id': None,
  390. 'leaf': True,
  391. 'model': u'>1000BASELX-1310',
  392. 'name': u'rx',
  393. 'serial': None},
  394. {'description': u'TX Port',
  395. 'id': None,
  396. 'leaf': True,
  397. 'model': u'<1000BASELX-1310',
  398. 'name': u'tx',
  399. 'serial': None}],
  400. 'description': u'NoName SFP LH transceiver',
  401. 'expanded': False,
  402. 'id': '528cb1b2f3b6821fee4bb0ee',
  403. 'model': u'NoName | Transceiver | 1G | SFP LH',
  404. 'name': u'Gi26_sfp',
  405. 'serial': u'H11L452'},
  406. {'description': '--- EMPTY ---',
  407. 'id': None,
  408. 'leaf': True,
  409. 'model': None,
  410. 'name': u'Gi27_sfp',
  411. 'serial': None},
  412. {'children': [{'description': u'TX Port',
  413. 'id': None,
  414. 'leaf': True,
  415. 'model': u'1000BASETX',
  416. 'name': u'port',
  417. 'serial': None}],
  418. 'description': u'Cisco-compatible SFP T transceiver',
  419. 'expanded': False,
  420. 'id': '528bb1e3f3b6820410d11c76',
  421. 'model': u'Avago | Transceiver | 1G | SFP T',
  422. 'name': u'Gi28_sfp',
  423. 'serial': u'AGM123521TU'}]
  424. _ = u'in'
  425. ------------------------------------------------------------------------
  426. File: /opt/noc/sa/apps/managedobject/views.py (Line: 523)
  427. Function: api_inventory
  428. 516 access="read", api=True)
  429. 517 def api_inventory(self, request, id):
  430. 518 o = self.get_object_or_404(ManagedObject, id=id)
  431. 519 if not o.has_access(request.user):
  432. 520 return self.response_forbidden("Access denied")
  433. 521 r = []
  434. 522 for p in o.get_inventory():
  435. 523 ==> c = self.get_nested_inventory(p)
  436. 524 c["name"] = p.model.description
  437. 525 r += [c]
  438. 526 return {
  439. 527 "expanded": True,
  440. 528 "children": r
  441. 529 }
  442. Variables:
  443. self =
  444. <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>
  445. request =
  446. <WSGIRequest
  447. path:/sa/managedobject/47/inventory/,
  448. GET:<QueryDict: {u'_dc': [u'1384974133451']}>,
  449. POST:<QueryDict: {}>,
  450. COOKIES:{'csrftoken': 'IE6aNOYA3mfrxpOJUvlG5H9owwYjbZke',
  451. 'sessionid': '3ded034749730c8f7fa8e5fd5040c44a'},
  452. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  453. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  454. 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
  455. 'HTTP_CONNECTION': 'close',
  456. 'HTTP_COOKIE': 'csrftoken=IE6aNOYA3mfrxpOJUvlG5H9owwYjbZke; sessionid=3ded034749730c8f7fa8e5fd5040c44a',
  457. 'HTTP_DNT': '1',
  458. 'HTTP_HOST': '127.0.0.1:8000',
  459. 'PATH_INFO': u'/sa/managedobject/47/inventory/',
  460. 'QUERY_STRING': '_dc=1384974133451',
  461. 'REMOTE_ADDR': '127.0.0.1',
  462. 'REQUEST_METHOD': 'GET',
  463. 'SCRIPT_NAME': u'',
  464. 'SERVER_NAME': '127.0.0.1',
  465. 'SERVER_PORT': '8000',
  466. 'SERVER_PROTOCOL': 'HTTP/1.0',
  467. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x807425ed0>,
  468. 'wsgi.input': <_io.BytesIO object at 0x80dfaead0>,
  469. 'wsgi.multiprocess': True,
  470. 'wsgi.multithread': False,
  471. 'wsgi.run_once': False,
  472. 'wsgi.url_scheme': 'http',
  473. 'wsgi.version': (1, 0)}>
  474. o = <ManagedObject: cat-36>
  475. p = <Object: 52851677f3b6822d9c1cda8f>
  476. r = []
  477. id = u'47'
  478. ------------------------------------------------------------------------
  479. File: /opt/noc/lib/app/site.py (Line: 232)
  480. Function: inner
  481. 225 for k, v in request.POST.lists())
  482. 226 elif request.method == "GET":
  483. 227 a = dict((k, v[0] if len(v) == 1 else v)
  484. 228 for k, v in request.GET.lists())
  485. 229 logging.debug("API %s %s %s" % (request.method,
  486. 230 request.path, a))
  487. 231 # Call handler
  488. 232 ==> r = v(request, *args, **kwargs)
  489. 233 # Dump SQL statements
  490. 234 if self.log_sql_statements:
  491. 235 from django.db import connections
  492. 236 tsc = 0
  493. 237 sc = defaultdict(int)
  494. 238 for conn in connections.all():
  495. Variables:
  496. args = ()
  497. view_map =
  498. {'GET': <bound method ManagedObjectApplication.api_inventory of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>>}
  499. Form = <class 'django.forms.forms.Form'>
  500. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  501. self = <noc.lib.app.site.Site object at 0x80a0d2050>
  502. v =
  503. <bound method ManagedObjectApplication.api_inventory of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>>
  504. request =
  505. <WSGIRequest
  506. path:/sa/managedobject/47/inventory/,
  507. GET:<QueryDict: {u'_dc': [u'1384974133451']}>,
  508. POST:<QueryDict: {}>,
  509. COOKIES:{'csrftoken': 'IE6aNOYA3mfrxpOJUvlG5H9owwYjbZke',
  510. 'sessionid': '3ded034749730c8f7fa8e5fd5040c44a'},
  511. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  512. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  513. 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
  514. 'HTTP_CONNECTION': 'close',
  515. 'HTTP_COOKIE': 'csrftoken=IE6aNOYA3mfrxpOJUvlG5H9owwYjbZke; sessionid=3ded034749730c8f7fa8e5fd5040c44a',
  516. 'HTTP_DNT': '1',
  517. 'HTTP_HOST': '127.0.0.1:8000',
  518. 'PATH_INFO': u'/sa/managedobject/47/inventory/',
  519. 'QUERY_STRING': '_dc=1384974133451',
  520. 'REMOTE_ADDR': '127.0.0.1',
  521. 'REQUEST_METHOD': 'GET',
  522. 'SCRIPT_NAME': u'',
  523. 'SERVER_NAME': '127.0.0.1',
  524. 'SERVER_PORT': '8000',
  525. 'SERVER_PROTOCOL': 'HTTP/1.0',
  526. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x807425ed0>,
  527. 'wsgi.input': <_io.BytesIO object at 0x80dfaead0>,
  528. 'wsgi.multiprocess': True,
  529. 'wsgi.multithread': False,
  530. 'wsgi.run_once': False,
  531. 'wsgi.url_scheme': 'http',
  532. 'wsgi.version': (1, 0)}>
  533. InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  534. to_log_api_call = False
  535. kwargs = {'id': u'47'}
  536. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  537. app =
  538. <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>
  539. ------------------------------------------------------------------------
  540. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement