Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HTTP/1.1 500 INTERNAL SERVER ERROR
- Cache-Control: no-cache
- Connection: keep-alive
- Content-Language: en-us
- Content-Length: 9564
- Content-Type: text/plain; charset=utf-8
- Date: Fri, 10 Aug 2012 10:49:18 GMT
- Expires: 0
- Pragme: no-cache
- Server: nginx/1.2.0
- Vary: Accept-Language, Cookie
- UNHANDLED EXCEPTION (2012-08-10 14:49:18.917594)
- Working directory: /opt/noc
- <class 'noc.sa.interfaces.base.InterfaceTypeError'>
- ModelParameter: 'Not found: 1'.
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/interfaces/base.py (Line: 55)
- Function: raise_error
- 48 :param value: Value where error detected
- 49 :type value: Arbitrary python type
- 50 :param msg: Optional message
- 51 :type msg: String
- 52 :raises InterfaceTypeError
- 53 """
- 54 raise InterfaceTypeError("%s: %s. %s" % (self.__class__.__name__,
- 55 ==> repr(value), msg))
- 56
- 57 def clean(self, value):
- 58 """
- 59 Input parameter normalization
- 60
- 61 :param value: Input parameter
- Variables:
- msg = ''
- self = <noc.sa.interfaces.base.ModelParameter object at 0x808fb24d0>
- value = 'Not found: 1'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/interfaces/base.py (Line: 1151)
- Function: clean
- 1144 try:
- 1145 value = int(value)
- 1146 except ValueError:
- 1147 self.raise_error(value)
- 1148 try:
- 1149 return self.model.objects.get(pk=value)
- 1150 except self.model.DoesNotExist:
- 1151 ==> self.raise_error("Not found: %d" % value)
- 1152
- 1153
- 1154 class DocumentParameter(Parameter):
- 1155 """
- 1156 Document reference parameter
- 1157 """
- Variables:
- self = <noc.sa.interfaces.base.ModelParameter object at 0x808fb24d0>
- value = 1
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/extmodelapplication.py (Line: 245)
- Function: cleaned_query
- 238 # dereference
- 239 try:
- 240 nq[np] = self.fk_fields[np].objects.get(**{lt: v})
- 241 except self.fk_fields[np].DoesNotExist:
- 242 nq[np] = 0 # False search
- 243 continue
- 244 elif np in self.clean_fields: # @todo: Check for valid lookup types
- 245 ==> v = self.clean_fields[np].clean(v)
- 246 # Write back
- 247 nq[p] = v
- 248 return nq
- 249
- 250 def instance_to_dict(self, o):
- 251 r = {}
- Variables:
- self = <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>
- q = {'vrf': u'1'}
- p = 'vrf'
- lt = None
- v = u'1'
- np = 'vrf'
- nq = {}
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/extmodelapplication.py (Line: 301)
- Function: list_data
- 294 ordering = []
- 295 if format == "ext" and self.sort_param in q:
- 296 for r in self.deserialize(q[self.sort_param]):
- 297 if r["direction"] == "DESC":
- 298 ordering += ["-%s" % r["property"]]
- 299 else:
- 300 ordering += [r["property"]]
- 301 ==> q = self.cleaned_query(q)
- 302 if None in q:
- 303 ew = q.pop(None)
- 304 data = self.queryset(request, query).filter(**q).extra(where=ew)
- 305 else:
- 306 data = self.queryset(request, query).filter(**q)
- 307 data = data.select_related()
- Variables:
- format = None
- ordering = []
- self = <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>
- request = <WSGIRequest
- GET:<QueryDict: {u'vrf': [u'1']}>,
- POST:<QueryDict: {}>,
- COOKIES:{},
- META:{'HTTP_ACCEPT': 'application/json',
- 'HTTP_ACCEPT_ENCODING': 'identity, deflate, compress, gzip',
- 'HTTP_AUTHORIZATION': 'Basic aXo6SDEtdGU0',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_USER_AGENT': 'HTTPie/0.2.7',
- 'PATH_INFO': u'/ip/prefix/',
- 'QUERY_STRING': 'vrf=1',
- '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 0x8040ef5d0>,
- 'wsgi.input': <_io.BytesIO object at 0x809a1cf50>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- q = {'vrf': u'1'}
- start = None
- limit = None
- query = None
- formatter = <bound method PrefixApplication.instance_to_dict of <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/extmodelapplication.py (Line: 357)
- Function: api_list
- 350 if None in q:
- 351 q[None] += [s]
- 352 else:
- 353 q[None] = [s]
- 354
- 355 @view(method=["GET"], url="^$", access="read", api=True)
- 356 def api_list(self, request):
- 357 ==> return self.list_data(request, self.instance_to_dict)
- 358
- 359 @view(method=["GET"], url=r"^lookup/$", access="lookup", api=True)
- 360 def api_lookup(self, request):
- 361 return self.list_data(request, self.instance_to_lookup)
- 362
- 363 @view(method=["POST"], url="^$", access="create", api=True)
- Variables:
- self = <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>
- request = <WSGIRequest
- GET:<QueryDict: {u'vrf': [u'1']}>,
- POST:<QueryDict: {}>,
- COOKIES:{},
- META:{'HTTP_ACCEPT': 'application/json',
- 'HTTP_ACCEPT_ENCODING': 'identity, deflate, compress, gzip',
- 'HTTP_AUTHORIZATION': 'Basic aXo6SDEtdGU0',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_USER_AGENT': 'HTTPie/0.2.7',
- 'PATH_INFO': u'/ip/prefix/',
- 'QUERY_STRING': 'vrf=1',
- '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 0x8040ef5d0>,
- 'wsgi.input': <_io.BytesIO object at 0x809a1cf50>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/site.py (Line: 226)
- Function: inner
- 219 for k, v in request.POST.lists())
- 220 elif request.method == "GET":
- 221 a = dict((k, v[0] if len(v) == 1 else v)
- 222 for k, v in request.GET.lists())
- 223 logging.debug("API %s %s %s" % (request.method,
- 224 request.path, a))
- 225 # Call handler
- 226 ==> r = v(request, *args, **kwargs)
- 227 # Dump SQL statements
- 228 if self.log_sql_statements:
- 229 from django.db import connections
- 230 tsc = 0
- 231 sc = defaultdict(int)
- 232 for conn in connections.all():
- Variables:
- args = ()
- 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>>}
- Form = <class 'django.forms.forms.Form'>
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- self = <noc.lib.app.site.Site object at 0x806105190>
- v = <bound method PrefixApplication.api_list of <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>>
- request = <WSGIRequest
- GET:<QueryDict: {u'vrf': [u'1']}>,
- POST:<QueryDict: {}>,
- COOKIES:{},
- META:{'HTTP_ACCEPT': 'application/json',
- 'HTTP_ACCEPT_ENCODING': 'identity, deflate, compress, gzip',
- 'HTTP_AUTHORIZATION': 'Basic aXo6SDEtdGU0',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_USER_AGENT': 'HTTPie/0.2.7',
- 'PATH_INFO': u'/ip/prefix/',
- 'QUERY_STRING': 'vrf=1',
- '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 0x8040ef5d0>,
- 'wsgi.input': <_io.BytesIO object at 0x809a1cf50>,
- '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 = {}
- app = <noc.ip.apps.prefix.views.PrefixApplication object at 0x808fb2250>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement