Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2012-08-03 15:48:53.045588)
- Working directory: /opt/noc
- <type 'exceptions.NameError'>
- global name 'UserAccess' is not defined
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/models/managedobjectselector.py (Line: 204)
- Function: objects_for_user
- 197 """
- 198 Returns queryset containing selector objects accessible to user,
- 199 optionally restricted to ones having scripts
- 200 :param user: User
- 201 :param scripts: optional list of scripts
- 202 :return:
- 203 """
- 204 ==> q = UserAccess.Q(user)
- 205 if scripts:
- 206 q &= Q(profile_name__in=self.scripts_profiles(scripts))
- 207 return self.managed_objects.filter(q)
- 208
- 209 @classmethod
- 210 def resolve_expression(cls, s):
- Variables:
- self = <ManagedObjectSelector: MEN_MPLS_Backbone>
- user = <User: iz>
- scripts = ['commands']
- ------------------------------------------------------------------------
- File: /opt/noc/sa/apps/runsnippet/views.py (Line: 149)
- Function: view_snippet
- 142 snippet.effective_permission_name)):
- 143 return self.response_forbidden("Forbidden")
- 144 vars = snippet.vars
- 145 has_vars = any([v for v in vars if vars[v]["type"] not in (
- 146 "internal", "hidden")])
- 147 map_task = self.get_map_script(snippet)
- 148 objects = list(snippet.selector.objects_for_user(request.user,
- 149 ==> [map_task]))
- 150 form = None
- 151 if request.POST:
- 152 objects = ManagedObject.objects.filter(id__in=[
- 153 int(n[4:]) for n in request.POST.keys()
- 154 if n.startswith("OBJ:") or n.startswith("CFM:")])
- 155 data = None
- Variables:
- vars = {u'vlan_id': {'required': True, 'type': 'str', 'label': u'vlan_id'}, u'name': {'required': True, 'type': 'str', 'label': u'name'}, u'vpn_id': {'required': True, 'type': 'str', 'label': u'vpn_id'}}
- self = <noc.sa.apps.runsnippet.views.RunSnippetApplication object at 0x808998a10>
- request = <WSGIRequest
- GET:<QueryDict: {}>,
- 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_REFERER': 'http://noc/sa/runsnippet/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1',
- 'PATH_INFO': u'/sa/runsnippet/10/',
- '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 0x8040f25d0>,
- 'wsgi.input': <_io.BytesIO object at 0x80963fd10>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- snippet = <CommandSnippet: Create_vfi>
- has_vars = True
- map_task = 'commands'
- v = u'vpn_id'
- snippet_id = u'10'
- ------------------------------------------------------------------------
- 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 = {'PUT': <bound method RunSnippetApplication.view_snippet of <noc.sa.apps.runsnippet.views.RunSnippetApplication object at 0x808998a10>>, 'POST': <bound method RunSnippetApplication.view_snippet of <noc.sa.apps.runsnippet.views.RunSnippetApplication object at 0x808998a10>>, 'GET': <bound method RunSnippetApplication.view_snippet of <noc.sa.apps.runsnippet.views.RunSnippetApplication object at 0x808998a10>>, 'DELETE': <bound method RunSnippetApplication.view_snippet of <noc.sa.apps.runsnippet.views.RunSnippetApplication object at 0x808998a10>>}
- Form = <class 'django.forms.forms.Form'>
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- self = <noc.lib.app.site.Site object at 0x8063821d0>
- v = <bound method RunSnippetApplication.view_snippet of <noc.sa.apps.runsnippet.views.RunSnippetApplication object at 0x808998a10>>
- request = <WSGIRequest
- GET:<QueryDict: {}>,
- 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_REFERER': 'http://noc/sa/runsnippet/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1',
- 'PATH_INFO': u'/sa/runsnippet/10/',
- '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 0x8040f25d0>,
- 'wsgi.input': <_io.BytesIO object at 0x80963fd10>,
- '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 = {'snippet_id': u'10'}
- app = <noc.sa.apps.runsnippet.views.RunSnippetApplication object at 0x808998a10>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement