Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2013-11-20 13:07:02.456484)
- Working directory: /usr/local/noc
- <class 'mongoengine.base.ValidationError'>
- Unable to dereference <class 'noc.inv.models.objectmodel.ObjectModel'>:528b7bf85c8b82725af590d4
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /usr/local/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: 528c440a5c8b821225468b1f>
- self = <noc.lib.nosql.PlainReferenceField object at 0x809971410>
- value = ObjectId('528b7bf85c8b82725af590d4')
- v = None
- ------------------------------------------------------------------------
- File: /usr/local/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 0x809229910>
- o = <Object: 528c440a5c8b821225468b1f>
- ------------------------------------------------------------------------
- File: /usr/local/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 0x809229910>
- request =
- <WSGIRequest
- path:/sa/managedobject/98/inventory/,
- GET:<QueryDict: {u'_dc': [u'1384938422397']}>,
- POST:<QueryDict: {}>,
- COOKIES:{'sessionid': '3e41a8ed7e4eb93ff3ab356637aa0ab2'},
- META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'sessionid=3e41a8ed7e4eb93ff3ab356637aa0ab2',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_REFERER': 'http://noc1.line-r.ru:8081/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0',
- 'HTTP_X_CLICKONCESUPPORT': '( .NET CLR 3.5.30729; .NET4.0E)',
- 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
- 'PATH_INFO': u'/sa/managedobject/98/inventory/',
- 'QUERY_STRING': '_dc=1384938422397',
- '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 0x804147ed0>,
- 'wsgi.input': <_io.BytesIO object at 0x8099dfa70>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- o = <ManagedObject: M80-cc-6509-1>
- p = <Object: 528c440a5c8b821225468b1f>
- r = []
- id = u'98'
- ------------------------------------------------------------------------
- File: /usr/local/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 0x809229910>>}
- Form = <class 'django.forms.forms.Form'>
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- self = <noc.lib.app.site.Site object at 0x806207210>
- v =
- <bound method ManagedObjectApplication.api_inventory of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x809229910>>
- request =
- <WSGIRequest
- path:/sa/managedobject/98/inventory/,
- GET:<QueryDict: {u'_dc': [u'1384938422397']}>,
- POST:<QueryDict: {}>,
- COOKIES:{'sessionid': '3e41a8ed7e4eb93ff3ab356637aa0ab2'},
- META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'sessionid=3e41a8ed7e4eb93ff3ab356637aa0ab2',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_REFERER': 'http://noc1.line-r.ru:8081/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0',
- 'HTTP_X_CLICKONCESUPPORT': '( .NET CLR 3.5.30729; .NET4.0E)',
- 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
- 'PATH_INFO': u'/sa/managedobject/98/inventory/',
- 'QUERY_STRING': '_dc=1384938422397',
- '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 0x804147ed0>,
- 'wsgi.input': <_io.BytesIO object at 0x8099dfa70>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- to_log_api_call = False
- InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
- PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
- kwargs = {'id': u'98'}
- app =
- <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x809229910>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement