Guest User

Untitled

a guest
Sep 2nd, 2014
240
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. UNHANDLED EXCEPTION (2014-09-02 16:51:59.270903)
  2. Working directory: /opt/noc
  3. <type 'exceptions.TypeError'>
  4. exceptions must be old-style classes or derived from BaseException, not HttpResponseNotFound
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/lib/app/application.py (Line: 236)
  8. Function: get_object_or_404
  9. 229 """
  10. 230 Shortcut to get_object_or_404
  11. 231 """
  12. 232 if hasattr(args[0], "_fields"):
  13. 233 # Document
  14. 234 r = args[0].objects.filter(**kwargs).first()
  15. 235 if not r:
  16. 236 ==> raise HttpResponseNotFound()
  17. 237 return r
  18. 238 else:
  19. 239 # Django model
  20. 240 return get_object_or_404(*args, **kwargs)
  21. 241
  22. 242 def render(self, request, template, dict={}, **kwargs):
  23. Variables:
  24. self = <noc.pm.apps.probe.views.ProbeApplication object at 0x811cf6c10>
  25. r = None
  26. args = (<class 'noc.pm.models.probe.Probe'>,)
  27. kwargs = {'name': u'default'}
  28. ------------------------------------------------------------------------
  29. File: /opt/noc/pm/apps/probe/views.py (Line: 37)
  30. Function: api_config
  31. 30 "last": DateTimeParameter(required=False)
  32. 31 },
  33. 32 access="config", api=True)
  34. 33 def api_config(self, request, name, instance, last=None):
  35. 34 """
  36. 35 Get full probe configuration
  37. 36 """
  38. 37 ==> probe = self.get_object_or_404(Probe, name=name)
  39. 38 if request.user.id != probe.user.id:
  40. 39 return self.response_forbidden()
  41. 40 instance = int(instance)
  42. 41 if instance >= probe.n_instances:
  43. 42 return self.response_not_found("Invalid instance")
  44. 43 probe_id = str(probe.id)
  45. Variables:
  46. request =
  47. <WSGIRequest
  48. path:/pm/probe/default/0/config/,
  49. GET:<QueryDict: {}>,
  50. POST:<QueryDict: {}>,
  51. COOKIES:{'csrftoken': 'Heph8r5sa8IhdtXSyhWHNNuLqfZsGqOc',
  52. 'sessionid': '2c8696a34a0e82877d57886d0fc6af51'},
  53. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  54. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  55. 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
  56. 'HTTP_CONNECTION': 'close',
  57. 'HTTP_COOKIE': 'csrftoken=Heph8r5sa8IhdtXSyhWHNNuLqfZsGqOc; sessionid=2c8696a34a0e82877d57886d0fc6af51',
  58. 'HTTP_DNT': '1',
  59. 'HTTP_HOST': '127.0.0.1:8000',
  60. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0',
  61. 'PATH_INFO': u'/pm/probe/default/0/config/',
  62. 'QUERY_STRING': '',
  63. 'REMOTE_ADDR': '127.0.0.1',
  64. 'REQUEST_METHOD': 'GET',
  65. 'SCRIPT_NAME': u'',
  66. 'SERVER_NAME': '127.0.0.1',
  67. 'SERVER_PORT': '8000',
  68. 'SERVER_PROTOCOL': 'HTTP/1.0',
  69. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x80754e390>,
  70. 'wsgi.input': <_io.BytesIO object at 0x8129aecb0>,
  71. 'wsgi.multiprocess': True,
  72. 'wsgi.multithread': False,
  73. 'wsgi.run_once': False,
  74. 'wsgi.url_scheme': 'http',
  75. 'wsgi.version': (1, 0)}>
  76. instance = u'0'
  77. self = <noc.pm.apps.probe.views.ProbeApplication object at 0x811cf6c10>
  78. last = None
  79. name = u'default'
  80. ------------------------------------------------------------------------
  81. File: /opt/noc/lib/app/site.py (Line: 242)
  82. Function: inner
  83. 235 for k, v in request.POST.lists())
  84. 236 elif request.method == "GET":
  85. 237 a = dict((k, v[0] if len(v) == 1 else v)
  86. 238 for k, v in request.GET.lists())
  87. 239 logging.debug("API %s %s %s" % (request.method,
  88. 240 request.path, a))
  89. 241 # Call handler
  90. 242 ==> r = v(request, *args, **kwargs)
  91. 243 # Dump SQL statements
  92. 244 if self.log_sql_statements:
  93. 245 from django.db import connections
  94. 246 tsc = 0
  95. 247 sc = defaultdict(int)
  96. 248 for conn in connections.all():
  97. Variables:
  98. errors = None
  99. view_map =
  100. {'GET': <bound method ProbeApplication.api_config of <noc.pm.apps.probe.views.ProbeApplication object at 0x811cf6c10>>}
  101. Form = <class 'django.forms.forms.Form'>
  102. g = {}
  103. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  104. request =
  105. <WSGIRequest
  106. path:/pm/probe/default/0/config/,
  107. GET:<QueryDict: {}>,
  108. POST:<QueryDict: {}>,
  109. COOKIES:{'csrftoken': 'Heph8r5sa8IhdtXSyhWHNNuLqfZsGqOc',
  110. 'sessionid': '2c8696a34a0e82877d57886d0fc6af51'},
  111. META:{'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': 'en-US,en;q=0.5',
  114. 'HTTP_CONNECTION': 'close',
  115. 'HTTP_COOKIE': 'csrftoken=Heph8r5sa8IhdtXSyhWHNNuLqfZsGqOc; sessionid=2c8696a34a0e82877d57886d0fc6af51',
  116. 'HTTP_DNT': '1',
  117. 'HTTP_HOST': '127.0.0.1:8000',
  118. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0',
  119. 'PATH_INFO': u'/pm/probe/default/0/config/',
  120. 'QUERY_STRING': '',
  121. 'REMOTE_ADDR': '127.0.0.1',
  122. 'REQUEST_METHOD': 'GET',
  123. 'SCRIPT_NAME': u'',
  124. 'SERVER_NAME': '127.0.0.1',
  125. 'SERVER_PORT': '8000',
  126. 'SERVER_PROTOCOL': 'HTTP/1.0',
  127. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x80754e390>,
  128. 'wsgi.input': <_io.BytesIO object at 0x8129aecb0>,
  129. 'wsgi.multiprocess': True,
  130. 'wsgi.multithread': False,
  131. 'wsgi.run_once': False,
  132. 'wsgi.url_scheme': 'http',
  133. 'wsgi.version': (1, 0)}>
  134. self = <noc.lib.app.site.Site object at 0x80dfef450>
  135. args = ()
  136. v =
  137. <bound method ProbeApplication.api_config of <noc.pm.apps.probe.views.ProbeApplication object at 0x811cf6c10>>
  138. InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  139. to_log_api_call = False
  140. kwargs = {'instance': u'0', 'name': u'default'}
  141. nq = <function nq at 0x812ad0c08>
  142. app = <noc.pm.apps.probe.views.ProbeApplication object at 0x811cf6c10>
  143. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  144. ------------------------------------------------------------------------
  145. END OF TRACEBACK
RAW Paste Data