Guest User

Untitled

a guest
Aug 10th, 2012
14
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. HTTP/1.1 500 INTERNAL SERVER ERROR
  2. Cache-Control: no-cache
  3. Connection: keep-alive
  4. Content-Language: en-us
  5. Content-Length: 9564
  6. Content-Type: text/plain; charset=utf-8
  7. Date: Fri, 10 Aug 2012 10:49:18 GMT
  8. Expires: 0
  9. Pragme: no-cache
  10. Server: nginx/1.2.0
  11. Vary: Accept-Language, Cookie
  12.  
  13. UNHANDLED EXCEPTION (2012-08-10 14:49:18.917594)
  14. Working directory: /opt/noc
  15. <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  16. ModelParameter: 'Not found: 1'.
  17. START OF TRACEBACK
  18. ------------------------------------------------------------------------
  19. File: /opt/noc/sa/interfaces/base.py (Line: 55)
  20. Function: raise_error
  21. 48 :param value: Value where error detected
  22. 49 :type value: Arbitrary python type
  23. 50 :param msg: Optional message
  24. 51 :type msg: String
  25. 52 :raises InterfaceTypeError
  26. 53 """
  27. 54 raise InterfaceTypeError("%s: %s. %s" % (self.__class__.__name__,
  28. 55 ==> repr(value), msg))
  29. 56
  30. 57 def clean(self, value):
  31. 58 """
  32. 59 Input parameter normalization
  33. 60
  34. 61 :param value: Input parameter
  35. Variables:
  36. msg = ''
  37. self = <noc.sa.interfaces.base.ModelParameter object at 0x808fb24d0>
  38. value = 'Not found: 1'
  39. ------------------------------------------------------------------------
  40. File: /opt/noc/sa/interfaces/base.py (Line: 1151)
  41. Function: clean
  42. 1144 try:
  43. 1145 value = int(value)
  44. 1146 except ValueError:
  45. 1147 self.raise_error(value)
  46. 1148 try:
  47. 1149 return self.model.objects.get(pk=value)
  48. 1150 except self.model.DoesNotExist:
  49. 1151 ==> self.raise_error("Not found: %d" % value)
  50. 1152
  51. 1153
  52. 1154 class DocumentParameter(Parameter):
  53. 1155 """
  54. 1156 Document reference parameter
  55. 1157 """
  56. Variables:
  57. self = <noc.sa.interfaces.base.ModelParameter object at 0x808fb24d0>
  58. value = 1
  59. ------------------------------------------------------------------------
  60. File: /opt/noc/lib/app/extmodelapplication.py (Line: 245)
  61. Function: cleaned_query
  62. 238 # dereference
  63. 239 try:
  64. 240 nq[np] = self.fk_fields[np].objects.get(**{lt: v})
  65. 241 except self.fk_fields[np].DoesNotExist:
  66. 242 nq[np] = 0 # False search
  67. 243 continue
  68. 244 elif np in self.clean_fields: # @todo: Check for valid lookup types
  69. 245 ==> v = self.clean_fields[np].clean(v)
  70. 246 # Write back
  71. 247 nq[p] = v
  72. 248 return nq
  73. 249
  74. 250 def instance_to_dict(self, o):
  75. 251 r = {}
  76. Variables:
  77. self = <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>
  78. q = {'vrf': u'1'}
  79. p = 'vrf'
  80. lt = None
  81. v = u'1'
  82. np = 'vrf'
  83. nq = {}
  84. ------------------------------------------------------------------------
  85. File: /opt/noc/lib/app/extmodelapplication.py (Line: 301)
  86. Function: list_data
  87. 294 ordering = []
  88. 295 if format == "ext" and self.sort_param in q:
  89. 296 for r in self.deserialize(q[self.sort_param]):
  90. 297 if r["direction"] == "DESC":
  91. 298 ordering += ["-%s" % r["property"]]
  92. 299 else:
  93. 300 ordering += [r["property"]]
  94. 301 ==> q = self.cleaned_query(q)
  95. 302 if None in q:
  96. 303 ew = q.pop(None)
  97. 304 data = self.queryset(request, query).filter(**q).extra(where=ew)
  98. 305 else:
  99. 306 data = self.queryset(request, query).filter(**q)
  100. 307 data = data.select_related()
  101. Variables:
  102. format = None
  103. ordering = []
  104. self = <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>
  105. request = <WSGIRequest
  106. GET:<QueryDict: {u'vrf': [u'1']}>,
  107. POST:<QueryDict: {}>,
  108. COOKIES:{},
  109. META:{'HTTP_ACCEPT': 'application/json',
  110. 'HTTP_ACCEPT_ENCODING': 'identity, deflate, compress, gzip',
  111. 'HTTP_AUTHORIZATION': 'Basic aXo6SDEtdGU0',
  112. 'HTTP_CONNECTION': 'close',
  113. 'HTTP_HOST': '127.0.0.1:8000',
  114. 'HTTP_USER_AGENT': 'HTTPie/0.2.7',
  115. 'PATH_INFO': u'/ip/prefix/',
  116. 'QUERY_STRING': 'vrf=1',
  117. 'REMOTE_ADDR': '127.0.0.1',
  118. 'REQUEST_METHOD': 'GET',
  119. 'SCRIPT_NAME': u'',
  120. 'SERVER_NAME': '127.0.0.1',
  121. 'SERVER_PORT': '8000',
  122. 'SERVER_PROTOCOL': 'HTTP/1.0',
  123. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x8040ef5d0>,
  124. 'wsgi.input': <_io.BytesIO object at 0x809a1cf50>,
  125. 'wsgi.multiprocess': True,
  126. 'wsgi.multithread': False,
  127. 'wsgi.run_once': False,
  128. 'wsgi.url_scheme': 'http',
  129. 'wsgi.version': (1, 0)}>
  130. q = {'vrf': u'1'}
  131. start = None
  132. limit = None
  133. query = None
  134. formatter = <bound method PrefixApplication.instance_to_dict of <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>>
  135. ------------------------------------------------------------------------
  136. File: /opt/noc/lib/app/extmodelapplication.py (Line: 357)
  137. Function: api_list
  138. 350 if None in q:
  139. 351 q[None] += [s]
  140. 352 else:
  141. 353 q[None] = [s]
  142. 354
  143. 355 @view(method=["GET"], url="^$", access="read", api=True)
  144. 356 def api_list(self, request):
  145. 357 ==> return self.list_data(request, self.instance_to_dict)
  146. 358
  147. 359 @view(method=["GET"], url=r"^lookup/$", access="lookup", api=True)
  148. 360 def api_lookup(self, request):
  149. 361 return self.list_data(request, self.instance_to_lookup)
  150. 362
  151. 363 @view(method=["POST"], url="^$", access="create", api=True)
  152. Variables:
  153. self = <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>
  154. request = <WSGIRequest
  155. GET:<QueryDict: {u'vrf': [u'1']}>,
  156. POST:<QueryDict: {}>,
  157. COOKIES:{},
  158. META:{'HTTP_ACCEPT': 'application/json',
  159. 'HTTP_ACCEPT_ENCODING': 'identity, deflate, compress, gzip',
  160. 'HTTP_AUTHORIZATION': 'Basic aXo6SDEtdGU0',
  161. 'HTTP_CONNECTION': 'close',
  162. 'HTTP_HOST': '127.0.0.1:8000',
  163. 'HTTP_USER_AGENT': 'HTTPie/0.2.7',
  164. 'PATH_INFO': u'/ip/prefix/',
  165. 'QUERY_STRING': 'vrf=1',
  166. 'REMOTE_ADDR': '127.0.0.1',
  167. 'REQUEST_METHOD': 'GET',
  168. 'SCRIPT_NAME': u'',
  169. 'SERVER_NAME': '127.0.0.1',
  170. 'SERVER_PORT': '8000',
  171. 'SERVER_PROTOCOL': 'HTTP/1.0',
  172. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x8040ef5d0>,
  173. 'wsgi.input': <_io.BytesIO object at 0x809a1cf50>,
  174. 'wsgi.multiprocess': True,
  175. 'wsgi.multithread': False,
  176. 'wsgi.run_once': False,
  177. 'wsgi.url_scheme': 'http',
  178. 'wsgi.version': (1, 0)}>
  179. ------------------------------------------------------------------------
  180. File: /opt/noc/lib/app/site.py (Line: 226)
  181. Function: inner
  182. 219 for k, v in request.POST.lists())
  183. 220 elif request.method == "GET":
  184. 221 a = dict((k, v[0] if len(v) == 1 else v)
  185. 222 for k, v in request.GET.lists())
  186. 223 logging.debug("API %s %s %s" % (request.method,
  187. 224 request.path, a))
  188. 225 # Call handler
  189. 226 ==> r = v(request, *args, **kwargs)
  190. 227 # Dump SQL statements
  191. 228 if self.log_sql_statements:
  192. 229 from django.db import connections
  193. 230 tsc = 0
  194. 231 sc = defaultdict(int)
  195. 232 for conn in connections.all():
  196. Variables:
  197. args = ()
  198. view_map = {'POST': <bound method PrefixApplication.api_create of <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>>, 'GET': <bound method PrefixApplication.api_list of <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>>}
  199. Form = <class 'django.forms.forms.Form'>
  200. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  201. self = <noc.lib.app.site.Site object at 0x806105190>
  202. v = <bound method PrefixApplication.api_list of <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>>
  203. request = <WSGIRequest
  204. GET:<QueryDict: {u'vrf': [u'1']}>,
  205. POST:<QueryDict: {}>,
  206. COOKIES:{},
  207. META:{'HTTP_ACCEPT': 'application/json',
  208. 'HTTP_ACCEPT_ENCODING': 'identity, deflate, compress, gzip',
  209. 'HTTP_AUTHORIZATION': 'Basic aXo6SDEtdGU0',
  210. 'HTTP_CONNECTION': 'close',
  211. 'HTTP_HOST': '127.0.0.1:8000',
  212. 'HTTP_USER_AGENT': 'HTTPie/0.2.7',
  213. 'PATH_INFO': u'/ip/prefix/',
  214. 'QUERY_STRING': 'vrf=1',
  215. 'REMOTE_ADDR': '127.0.0.1',
  216. 'REQUEST_METHOD': 'GET',
  217. 'SCRIPT_NAME': u'',
  218. 'SERVER_NAME': '127.0.0.1',
  219. 'SERVER_PORT': '8000',
  220. 'SERVER_PROTOCOL': 'HTTP/1.0',
  221. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x8040ef5d0>,
  222. 'wsgi.input': <_io.BytesIO object at 0x809a1cf50>,
  223. 'wsgi.multiprocess': True,
  224. 'wsgi.multithread': False,
  225. 'wsgi.run_once': False,
  226. 'wsgi.url_scheme': 'http',
  227. 'wsgi.version': (1, 0)}>
  228. to_log_api_call = False
  229. InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  230. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  231. kwargs = {}
  232. app = <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>
  233. ------------------------------------------------------------------------
  234. END OF TRACEBACK
RAW Paste Data