Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2012-08-07 10:21:15.066458)
- Working directory: /opt/noc
- <type 'exceptions.NameError'>
- global name 'VC' is not defined
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/vc/models/vcdomain.py (Line: 67)
- Function: get_free_label
- 60 else:
- 61 chunks = VCFilter.compile(vc_filter.expression)
- 62 # Find first free
- 63 for x, y in chunks:
- 64 if x > y or y < l_min or x > l_max:
- 65 continue # Skip chunk outside of type's range
- 66 for l in range(max(l_min, x), min(l_max, y) + 1):
- 67 ==> if not VC.objects.filter(vc_domain=self, l1=l).exists():
- 68 return l # Return first free found
- 69 return None # Nothing found
- Variables:
- l_max = 4095
- self = <VCDomain: NN>
- vc_filter = <VCFilter: To-sovintel>
- l = 2500
- chunks = [(2500, 2999)]
- y = 2999
- x = 2500
- l_min = 1
- ------------------------------------------------------------------------
- File: /opt/noc/vc/apps/vc/views.py (Line: 89)
- Function: api_find_free
- 82
- 83 @view(url="^find_free/$", method=["GET"], access="read", api=True,
- 84 validate={
- 85 "vc_domain": ModelParameter(VCDomain),
- 86 "vc_filter": ModelParameter(VCFilter)
- 87 })
- 88 def api_find_free(self, request, vc_domain, vc_filter, **kwargs):
- 89 ==> return vc_domain.get_free_label(vc_filter)
- 90
- 91 @view(url="^bulk/import/", method=["POST"], access="import", api=True,
- 92 validate={
- 93 "vc_domain": ModelParameter(VCDomain),
- 94 "items": ListOfParameter(element=DictParameter(attrs={
- 95 "l1": IntParameter(),
- Variables:
- vc_domain = <VCDomain: NN>
- self = <noc.vc.apps.vc.views.VCApplication object at 0x80918d050>
- vc_filter = <VCFilter: To-sovintel>
- request = <WSGIRequest
- GET:<QueryDict: {u'vc_domain': [u'16'], u'_dc': [u'1344320454528'], u'vc_filter': [u'14']}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': '15fc69f1ce3ad129e1695ed1affac5e2',
- 'sessionid': 'ea43713788bea92af05c2f2957188983'},
- 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': 'csrftoken=15fc69f1ce3ad129e1695ed1affac5e2; sessionid=ea43713788bea92af05c2f2957188983',
- 'HTTP_DNT': '1',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1',
- 'PATH_INFO': u'/vc/vc/find_free/',
- 'QUERY_STRING': '_dc=1344320454528&vc_domain=16&vc_filter=14',
- '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 0x809d14290>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- kwargs = {}
- ------------------------------------------------------------------------
- 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:
- errors = None
- view_map = {'GET': <bound method VCApplication.api_find_free of <noc.vc.apps.vc.views.VCApplication object at 0x80918d050>>}
- Form = <class 'django.forms.forms.Form'>
- g = {u'vc_domain': u'16', u'vc_filter': u'14'}
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- request = <WSGIRequest
- GET:<QueryDict: {u'vc_domain': [u'16'], u'_dc': [u'1344320454528'], u'vc_filter': [u'14']}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': '15fc69f1ce3ad129e1695ed1affac5e2',
- 'sessionid': 'ea43713788bea92af05c2f2957188983'},
- 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': 'csrftoken=15fc69f1ce3ad129e1695ed1affac5e2; sessionid=ea43713788bea92af05c2f2957188983',
- 'HTTP_DNT': '1',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1',
- 'PATH_INFO': u'/vc/vc/find_free/',
- 'QUERY_STRING': '_dc=1344320454528&vc_domain=16&vc_filter=14',
- '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 0x809d14290>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- self = <noc.lib.app.site.Site object at 0x8063936d0>
- args = ()
- v = <bound method VCApplication.api_find_free of <noc.vc.apps.vc.views.VCApplication object at 0x80918d050>>
- InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
- to_log_api_call = False
- kwargs = {'vc_domain': <VCDomain: NN>, 'vc_filter': <VCFilter: To-sovintel>}
- PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
- app = <noc.vc.apps.vc.views.VCApplication object at 0x80918d050>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment