Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2012-10-17 17:02:21.137814)
- Working directory: /usr/local/noc
- <type 'exceptions.TypeError'>
- ObjectId('503ccdcb5c8b8212bf000e4a') is not JSON serializable
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /usr/local/lib/python2.7/json/encoder.py (Line: 178)
- Function: default
- 171 except TypeError:
- 172 pass
- 173 else:
- 174 return list(iterable)
- 175 return JSONEncoder.default(self, o)
- 176
- 177 """
- 178 ==> raise TypeError(repr(o) + " is not JSON serializable")
- 179
- 180 def encode(self, o):
- 181 """Return a JSON string representation of a Python data structure.
- 182
- 183 >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
- 184 '{"foo": ["bar", "baz"]}'
- Variables:
- self = <json.encoder.JSONEncoder object at 0x801bc3e10>
- o = ObjectId('503ccdcb5c8b8212bf000e4a')
- ------------------------------------------------------------------------
- File: /usr/local/lib/python2.7/json/encoder.py (Line: 264)
- Function: iterencode
- 257 self.key_separator, self.item_separator, self.sort_keys,
- 258 self.skipkeys, self.allow_nan)
- 259 else:
- 260 _iterencode = _make_iterencode(
- 261 markers, self.default, _encoder, self.indent, floatstr,
- 262 self.key_separator, self.item_separator, self.sort_keys,
- 263 self.skipkeys, _one_shot)
- 264 ==> return _iterencode(o, 0)
- 265
- 266 def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
- 267 _key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot,
- 268 ## HACK: hand-optimized bytecode; turn globals into locals
- 269 ValueError=ValueError,
- 270 basestring=basestring,
- Variables:
- _encoder = <built-in function encode_basestring_ascii>
- floatstr = <function floatstr at 0x808f48c80>
- self = <json.encoder.JSONEncoder object at 0x801bc3e10>
- o = [{'managed_object__label': u'Vsev.Ujnyi.Dobrovol-20-2-es3526-2-1.line-r.ru', 'vlan': 1, 'managed_object': 263, 'last_changed': u'2012-10-17 02:56:23.460000', 'mac': u'00:1D:0F:CE:5F:0D', 'fav_status': False, 'interface': ObjectId('503ccdcb5c8b8212bf000e4a'), 'id': u'507db5775c8b823777000000'}, {'managed_object__label': u'e38-cc-1-4-6506', 'vlan': 241, 'managed_object': 116, 'last_changed': u'2012-10-17 00:12:46.416000', 'mac': u'00:23:F8:5B:C7:35', 'fav_status': False, 'interface': ObjectId('5017cafa5c8b820f9a0001cd'), 'id': u'507db5775c8b823777000001'}]
- _one_shot = True
- markers = {34509283128: [{'managed_object__label': u'Vsev.Ujnyi.Dobrovol-20-2-es3526-2-1.line-r.ru', 'vlan': 1, 'managed_object': 263, 'last_changed': u'2012-10-17 02:56:23.460000', 'mac': u'00:1D:0F:CE:5F:0D', 'fav_status': False, 'interface': ObjectId('503ccdcb5c8b8212bf000e4a'), 'id': u'507db5775c8b823777000000'}, {'managed_object__label': u'e38-cc-1-4-6506', 'vlan': 241, 'managed_object': 116, 'last_changed': u'2012-10-17 00:12:46.416000', 'mac': u'00:23:F8:5B:C7:35', 'fav_status': False, 'interface': ObjectId('5017cafa5c8b820f9a0001cd'), 'id': u'507db5775c8b823777000001'}]
- _iterencode = <_json.Encoder object at 0x808f48de8>
- ------------------------------------------------------------------------
- File: /usr/local/lib/python2.7/json/encoder.py (Line: 201)
- Function: encode
- 194 if self.ensure_ascii:
- 195 return encode_basestring_ascii(o)
- 196 else:
- 197 return encode_basestring(o)
- 198 # This doesn't pass the iterator directly to ''.join() because the
- 199 # exceptions aren't as detailed. The list call should be roughly
- 200 # equivalent to the PySequence_Fast that ''.join() would do.
- 201 ==> chunks = self.iterencode(o, _one_shot=True)
- 202 if not isinstance(chunks, (list, tuple)):
- 203 chunks = list(chunks)
- 204 return ''.join(chunks)
- 205
- 206 def iterencode(self, o, _one_shot=False):
- 207 """Encode the given object and yield each string
- Variables:
- self = <json.encoder.JSONEncoder object at 0x801bc3e10>
- o = [{'managed_object__label': u'Vsev.Ujnyi.Dobrovol-20-2-es3526-2-1.line-r.ru', 'vlan': 1, ----etc
- ------------------------------------------------------------------------
- File: /usr/local/lib/python2.7/json/__init__.py (Line: 231)
- Function: dumps
- 224
- 225 """
- 226 # cached encoder
- 227 if (not skipkeys and ensure_ascii and
- 228 check_circular and allow_nan and
- 229 cls is None and indent is None and separators is None and
- 230 encoding == 'utf-8' and default is None and not kw):
- 231 ==> return _default_encoder.encode(obj)
- 232 if cls is None:
- 233 cls = JSONEncoder
- 234 return cls(
- 235 skipkeys=skipkeys, ensure_ascii=ensure_ascii,
- 236 check_circular=check_circular, allow_nan=allow_nan, indent=indent,
- 237 separators=separators, encoding=encoding, default=default,
- Variables:
- indent = None
- encoding = 'utf-8'
- default = None
- separators = None
- skipkeys = False
- kw = {}
- check_circular = True
- allow_nan = True
- obj = [{'managed_object__label': u'Vsev.Ujnyi.Dobrovol-20-2-es3526-2-1.line-r.ru', 'vlan': 1, 'managed_object': 263 ---etc
- ensure_ascii = True
- cls = None
- ------------------------------------------------------------------------
- File: /usr/local/noc/lib/app/extapplication.py (Line: 66)
- Function: response
- 59 return HasPerm("%s:%s:launch" % (m, a))
- 60
- 61 def deserialize(self, data):
- 62 return json_decode(data)
- 63
- 64 def response(self, content="", status=200):
- 65 if not isinstance(content, basestring):
- 66 ==> return HttpResponse(json_encode(content),
- 67 mimetype="text/json; charset=utf-8",
- 68 status=status)
- 69 else:
- 70 return HttpResponse(content,
- 71 mimetype="text/plain; charset=utf-8",
- 72 status=status)
- Variables:
- status = 200
- content = [{'managed_object__label': u'Vsev.Ujnyi.Dobrovol-20-2-es3526-2-1.line-r.ru', 'vlan': 1, 'managed_object': 263, 'last_changed': u'2012-10-17 02:56:23.460000', 'mac': u'00:1D:0F:CE:5F:0D', 'fav_status': False, 'interface': ObjectId('503ccdcb5c8b8212bf000e4a'), 'id': u'507db5775c8b823777000000'}, ---etc
- self = <noc.inv.apps.macdb.views.MACApplication object at 0x808450d50>
- ------------------------------------------------------------------------
- File: /usr/local/noc/lib/app/extapplication.py (Line: 158)
- Function: list_data
- 151 r[self.fav_status] = r["id"] in fav_items
- 152 if format == "ext":
- 153 out = {
- 154 "total": total,
- 155 "success": True,
- 156 "data": out
- 157 }
- 158 ==> return self.response(out, status=self.OK)
- 159
- 160 @view(url="^(?P<path>(?:js|css|img)/[0-9a-zA-Z_/]+\.(?:js|css|png))$",
- 161 url_name="static", access=True)
- 162 def view_static(self, request, path):
- 163 """
- 164 Static file server
- Variables:
- fs = None
- format = None
- ordering = []
- self = <noc.inv.apps.macdb.views.MACApplication object at 0x808450d50>
- request = <WSGIRequest
- path:/inv/macdb/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': 'w026pMQKaZ7OrQFlY3UDcfB6P8ZcUgOu',
- 'sessionid': 'c3b60fa600f1360a07443dbedb4357da'},
- 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=c3b60fa600f1360a07443dbedb4357da; csrftoken=w026pMQKaZ7OrQFlY3UDcfB6P8ZcUgOu',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1',
- 'HTTP_X_CLICKONCESUPPORT': '( .NET CLR 3.5.30729; .NET4.0E)',
- 'PATH_INFO': u'/inv/macdb/',
- 'QUERY_STRING': '',
- '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 0x804235f60>,
- 'wsgi.input': <_io.BytesIO object at 0x808e39d10>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- o = <MACDB: E0:CB:4E:48:E7:A3>
- q = {}
- start = None
- only = None
- r = {'managed_object__label': u'bolsheoxt-6-1-es3528.line-r.ru', 'vlan': 91, 'managed_object': 114, 'last_changed': u'2012-10-17 16:49:37.989000', 'mac': u'E0:CB:4E:48:E7:A3', 'fav_status': False, 'interface': ObjectId('5017ce3c5c8b820f9a001022'), 'id': u'507ea9615c8b824826000078'}
- limit = None
- formatter = <bound method MACApplication.instance_to_dict of <noc.inv.apps.macdb.views.MACApplication object at 0x808450d50>>
- query = None
- out = [{'managed_object__label': u'Vsev.Ujnyi.Dobrovol-20-2-es3526-2-1.line-r.ru', 'vlan': 1, 'managed_object': 263, 'last_changed': u'2012-10-17 02:56:23.460000', 'mac': u'00:1D:0F:CE:5F:0D', 'fav_status': False, 'interface': ObjectId('503ccdcb5c8b8212bf000e4a'), 'id': u'507db5775c8b823777000000'}, {'managed_object__label': ---etc
- data = [<MACDB: 00:1D:0F:CE:5F:0D>, <MACDB: 00:23:F8:5B:C7:35>, <MACDB: 54:04:A6:BC:03:AC>, <MACDB: B8:A3:86:21:9B:81>, <MACDB: 00:21:CC:70:5D:BD>, <MACDB: 28:10:7B:CF:0D:77>, <MACDB: 00:13:77:3E:A9:1F>, <MACDB: 00:24:54:DF:3A:82>, ---etc
- fav_items = set([])
- ------------------------------------------------------------------------
- File: /usr/local/noc/lib/app/extdocapplication.py (Line: 145)
- Function: api_list
- 138 return {
- 139 "id": str(o.id),
- 140 "label": unicode(o)
- 141 }
- 142
- 143 @view(method=["GET"], url="^$", access="read", api=True)
- 144 def api_list(self, request):
- 145 ==> return self.list_data(request, self.instance_to_dict)
- 146
- 147 @view(method=["GET"], url=r"^lookup/$", access="lookup", api=True)
- 148 def api_lookup(self, request):
- 149 return self.list_data(request, self.instance_to_lookup)
- 150
- 151 @view(method=["POST"], url="^$", access="create", api=True)
- Variables:
- self = <noc.inv.apps.macdb.views.MACApplication object at 0x808450d50>
- request = <WSGIRequest
- path:/inv/macdb/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': 'w026pMQKaZ7OrQFlY3UDcfB6P8ZcUgOu',
- 'sessionid': 'c3b60fa600f1360a07443dbedb4357da'},
- 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=c3b60fa600f1360a07443dbedb4357da; csrftoken=w026pMQKaZ7OrQFlY3UDcfB6P8ZcUgOu',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1',
- 'HTTP_X_CLICKONCESUPPORT': '( .NET CLR 3.5.30729; .NET4.0E)',
- 'PATH_INFO': u'/inv/macdb/',
- 'QUERY_STRING': '',
- '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 0x804235f60>,
- 'wsgi.input': <_io.BytesIO object at 0x808e39d10>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- ------------------------------------------------------------------------
- File: /usr/local/noc/lib/app/site.py (Line: 231)
- Function: inner
- 224 for k, v in request.POST.lists())
- 225 elif request.method == "GET":
- 226 a = dict((k, v[0] if len(v) == 1 else v)
- 227 for k, v in request.GET.lists())
- 228 logging.debug("API %s %s %s" % (request.method,
- 229 request.path, a))
- 230 # Call handler
- 231 ==> r = v(request, *args, **kwargs)
- 232 # Dump SQL statements
- 233 if self.log_sql_statements:
- 234 from django.db import connections
- 235 tsc = 0
- 236 sc = defaultdict(int)
- 237 for conn in connections.all():
- Variables:
- args = ()
- view_map = {'POST': <bound method MACApplication.api_create of <noc.inv.apps.macdb.views.MACApplication object at 0x808450d50>>, 'GET': <bound method MACApplication.api_list of <noc.inv.apps.macdb.views.MACApplication object at 0x808450d50>>}
- Form = <class 'django.forms.forms.Form'>
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- self = <noc.lib.app.site.Site object at 0x806415e50>
- v = <bound method MACApplication.api_list of <noc.inv.apps.macdb.views.MACApplication object at 0x808450d50>>
- request = <WSGIRequest
- path:/inv/macdb/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': 'w026pMQKaZ7OrQFlY3UDcfB6P8ZcUgOu',
- 'sessionid': 'c3b60fa600f1360a07443dbedb4357da'},
- 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=c3b60fa600f1360a07443dbedb4357da; csrftoken=w026pMQKaZ7OrQFlY3UDcfB6P8ZcUgOu',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1',
- 'HTTP_X_CLICKONCESUPPORT': '( .NET CLR 3.5.30729; .NET4.0E)',
- 'PATH_INFO': u'/inv/macdb/',
- 'QUERY_STRING': '',
- '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 0x804235f60>,
- 'wsgi.input': <_io.BytesIO object at 0x808e39d10>,
- '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.inv.apps.macdb.views.MACApplication object at 0x808450d50>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement