Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2013-11-20 23:02:03.691732)
- Working directory: /opt/noc
- <class 'mongoengine.base.ValidationError'>
- Unable to dereference <class 'noc.inv.models.objectmodel.ObjectModel'>:528c77e7f3b68213faf03d45
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nosql.py (Line: 103)
- Function: __get__
- 96 # Dereference DBRefs
- 97 if isinstance(value, ObjectId):
- 98 v = self.document_type.objects(id=value).first()
- 99 if v is not None:
- 100 instance._data[self.name] = v
- 101 else:
- 102 raise ValidationError("Unable to dereference %s:%s" % (
- 103 ==> self.document_type, value))
- 104 return super(PlainReferenceField, self).__get__(instance, owner)
- 105
- 106 def to_mongo(self, document):
- 107 if isinstance(document, Document):
- 108 # We need the id from the saved object to create the DBRef
- 109 id_ = document.id
- Variables:
- owner = <class 'noc.inv.models.object.Object'>
- instance = <Object: 528c785ef3b682169aeb26c2>
- self = <noc.lib.nosql.PlainReferenceField object at 0x80d74dc90>
- value = ObjectId('528c77e7f3b68213faf03d45')
- v = None
- ------------------------------------------------------------------------
- File: /opt/noc/sa/apps/managedobject/views.py (Line: 478)
- Function: get_nested_inventory
- 471 self.discovery_scheduler = DiscoveryScheduler()
- 472 self.discovery_scheduler.ensure_job(job_name, managed_object)
- 473
- 474 def get_nested_inventory(self, o):
- 475 r = {
- 476 "id": str(o.id),
- 477 "serial": o.get_data("asset", "serial"),
- 478 ==> "description": o.model.description,
- 479 "model": o.model.name
- 480 }
- 481 children = []
- 482 for n in o.model.connections:
- 483 if n.direction == "i":
- 484 c, r_object, _ = o.get_p2p_connection(n.name)
- Variables:
- self =
- <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>
- o = <Object: 528c785ef3b682169aeb26c2>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/apps/managedobject/views.py (Line: 495)
- Function: get_nested_inventory
- 488 "name": n.name,
- 489 "leaf": True,
- 490 "serial": None,
- 491 "description": "--- EMPTY ---",
- 492 "model": None
- 493 }]
- 494 else:
- 495 ==> cc = self.get_nested_inventory(r_object)
- 496 cc["name"] = n.name
- 497 children += [cc]
- 498 elif n.direction == "s":
- 499 children += [{
- 500 "id": None,
- 501 "name": n.name,
- Variables:
- c =
- <ObjectConnection: <528c785ef3b682169aeb26c2: in, 52851677f3b6822d9c1cda8f: Te29_x2>>
- cc =
- {'children': [{'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'1000BASETX',
- 'name': u'port',
- 'serial': None}],
- 'description': u'Cisco-compatible SFP T transceiver',
- 'expanded': False,
- 'id': '528bb1e3f3b6820410d11c76',
- 'model': u'Avago | Transceiver | 1G | SFP T',
- 'name': u'Gi28_sfp',
- 'serial': u'AGM123521TU'}
- self =
- <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>
- o = <Object: 52851677f3b6822d9c1cda8f>
- n = <ObjectModelConnection: Te29_x2>
- r_object = <Object: 528c785ef3b682169aeb26c2>
- r =
- {'description': u'Cisco ME4924-10GE Layer-3 ethernet aggregation switch',
- 'id': '52851677f3b6822d9c1cda8f',
- 'model': u'Cisco | 4500 | ME-4924-10GE',
- 'serial': u'FOX1216GWCL'}
- children =
- [{'description': u'Console port',
- 'id': None,
- 'leaf': True,
- 'model': u'>RS232',
- 'name': u'Console',
- 'serial': None},
- {'description': u'FastEthernet management port',
- 'id': None,
- 'leaf': True,
- 'model': u'10BASET, 100BASETX',
- 'name': u'Fa0',
- 'serial': None},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'LH/LX transceiver without DOM support',
- 'expanded': False,
- 'id': '528bb1e3f3b6820410d11c6f',
- 'model': u'Avago | Transceiver | 1G | SFP LH',
- 'name': u'Gi1_sfp',
- 'serial': u'AGC1526UPRV'},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'NoName SFP LH transceiver',
- 'expanded': False,
- 'id': '528cb1b2f3b6821fee4bb0e6',
- 'model': u'NoName | Transceiver | 1G | SFP LH',
- 'name': u'Gi2_sfp',
- 'serial': u'H11L432'},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'LH/LX transceiver without DOM support',
- 'expanded': False,
- 'id': '528bb1e3f3b6820410d11c70',
- 'model': u'Finisar | Transceiver | 1G | SFP LH',
- 'name': u'Gi3_sfp',
- 'serial': u'FNS0838K0WZ'},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi4_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi5_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi6_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi7_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi8_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi9_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi10_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi11_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi12_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi13_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi14_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi15_sfp',
- 'serial': None},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'LH/LX transceiver without DOM support',
- 'expanded': False,
- 'id': '528bb1e3f3b6820410d11c71',
- 'model': u'Finisar | Transceiver | 1G | SFP LH',
- 'name': u'Gi16_sfp',
- 'serial': u'FNS164617AE'},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'LH/LX transceiver without DOM support',
- 'expanded': False,
- 'id': '528bb1e3f3b6820410d11c72',
- 'model': u'Avago | Transceiver | 1G | SFP LH',
- 'name': u'Gi17_sfp',
- 'serial': u'AGC1527UNTS'},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'LH/LX transceiver without DOM support',
- 'expanded': False,
- 'id': '528bb1e3f3b6820410d11c73',
- 'model': u'Finisar | Transceiver | 1G | SFP LH',
- 'name': u'Gi18_sfp',
- 'serial': u'FNS16460D46'},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'NoName SFP LH transceiver',
- 'expanded': False,
- 'id': '528cb1b2f3b6821fee4bb0e8',
- 'model': u'NoName | Transceiver | 1G | SFP LH',
- 'name': u'Gi19_sfp',
- 'serial': u'H22L019'},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'NoName SFP LH transceiver',
- 'expanded': False,
- 'id': '528cb1b2f3b6821fee4bb0ea',
- 'model': u'NoName | Transceiver | 1G | SFP LH',
- 'name': u'Gi20_sfp',
- 'serial': u'H22L015'},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'LH/LX transceiver without DOM support',
- 'expanded': False,
- 'id': '528bb1e3f3b6820410d11c74',
- 'model': u'Avago | Transceiver | 1G | SFP LH',
- 'name': u'Gi21_sfp',
- 'serial': u'AGC1527UNUW'},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'LH/LX transceiver without DOM support',
- 'expanded': False,
- 'id': '528bb1e3f3b6820410d11c75',
- 'model': u'Avago | Transceiver | 1G | SFP LH',
- 'name': u'Gi22_sfp',
- 'serial': u'AGC1512UNB4'},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi23_sfp',
- 'serial': None},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi24_sfp',
- 'serial': None},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'NoName SFP LH transceiver',
- 'expanded': False,
- 'id': '528cb1b2f3b6821fee4bb0ec',
- 'model': u'NoName | Transceiver | 1G | SFP LH',
- 'name': u'Gi25_sfp',
- 'serial': u'H11L456'},
- {'children': [{'description': u'RX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'>1000BASELX-1310',
- 'name': u'rx',
- 'serial': None},
- {'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'<1000BASELX-1310',
- 'name': u'tx',
- 'serial': None}],
- 'description': u'NoName SFP LH transceiver',
- 'expanded': False,
- 'id': '528cb1b2f3b6821fee4bb0ee',
- 'model': u'NoName | Transceiver | 1G | SFP LH',
- 'name': u'Gi26_sfp',
- 'serial': u'H11L452'},
- {'description': '--- EMPTY ---',
- 'id': None,
- 'leaf': True,
- 'model': None,
- 'name': u'Gi27_sfp',
- 'serial': None},
- {'children': [{'description': u'TX Port',
- 'id': None,
- 'leaf': True,
- 'model': u'1000BASETX',
- 'name': u'port',
- 'serial': None}],
- 'description': u'Cisco-compatible SFP T transceiver',
- 'expanded': False,
- 'id': '528bb1e3f3b6820410d11c76',
- 'model': u'Avago | Transceiver | 1G | SFP T',
- 'name': u'Gi28_sfp',
- 'serial': u'AGM123521TU'}]
- _ = u'in'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/apps/managedobject/views.py (Line: 523)
- Function: api_inventory
- 516 access="read", api=True)
- 517 def api_inventory(self, request, id):
- 518 o = self.get_object_or_404(ManagedObject, id=id)
- 519 if not o.has_access(request.user):
- 520 return self.response_forbidden("Access denied")
- 521 r = []
- 522 for p in o.get_inventory():
- 523 ==> c = self.get_nested_inventory(p)
- 524 c["name"] = p.model.description
- 525 r += [c]
- 526 return {
- 527 "expanded": True,
- 528 "children": r
- 529 }
- Variables:
- self =
- <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>
- request =
- <WSGIRequest
- path:/sa/managedobject/47/inventory/,
- GET:<QueryDict: {u'_dc': [u'1384974133451']}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': 'IE6aNOYA3mfrxpOJUvlG5H9owwYjbZke',
- 'sessionid': '3ded034749730c8f7fa8e5fd5040c44a'},
- META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'csrftoken=IE6aNOYA3mfrxpOJUvlG5H9owwYjbZke; sessionid=3ded034749730c8f7fa8e5fd5040c44a',
- 'HTTP_DNT': '1',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'PATH_INFO': u'/sa/managedobject/47/inventory/',
- 'QUERY_STRING': '_dc=1384974133451',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REQUEST_METHOD': 'GET',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': '127.0.0.1',
- 'SERVER_PORT': '8000',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x807425ed0>,
- 'wsgi.input': <_io.BytesIO object at 0x80dfaead0>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- o = <ManagedObject: cat-36>
- p = <Object: 52851677f3b6822d9c1cda8f>
- r = []
- id = u'47'
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/site.py (Line: 232)
- Function: inner
- 225 for k, v in request.POST.lists())
- 226 elif request.method == "GET":
- 227 a = dict((k, v[0] if len(v) == 1 else v)
- 228 for k, v in request.GET.lists())
- 229 logging.debug("API %s %s %s" % (request.method,
- 230 request.path, a))
- 231 # Call handler
- 232 ==> r = v(request, *args, **kwargs)
- 233 # Dump SQL statements
- 234 if self.log_sql_statements:
- 235 from django.db import connections
- 236 tsc = 0
- 237 sc = defaultdict(int)
- 238 for conn in connections.all():
- Variables:
- args = ()
- view_map =
- {'GET': <bound method ManagedObjectApplication.api_inventory of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>>}
- Form = <class 'django.forms.forms.Form'>
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- self = <noc.lib.app.site.Site object at 0x80a0d2050>
- v =
- <bound method ManagedObjectApplication.api_inventory of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>>
- request =
- <WSGIRequest
- path:/sa/managedobject/47/inventory/,
- GET:<QueryDict: {u'_dc': [u'1384974133451']}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': 'IE6aNOYA3mfrxpOJUvlG5H9owwYjbZke',
- 'sessionid': '3ded034749730c8f7fa8e5fd5040c44a'},
- META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'csrftoken=IE6aNOYA3mfrxpOJUvlG5H9owwYjbZke; sessionid=3ded034749730c8f7fa8e5fd5040c44a',
- 'HTTP_DNT': '1',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'PATH_INFO': u'/sa/managedobject/47/inventory/',
- 'QUERY_STRING': '_dc=1384974133451',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REQUEST_METHOD': 'GET',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': '127.0.0.1',
- 'SERVER_PORT': '8000',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x807425ed0>,
- 'wsgi.input': <_io.BytesIO object at 0x80dfaead0>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
- to_log_api_call = False
- kwargs = {'id': u'47'}
- PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
- app =
- <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x80d813b50>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement