Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.26 KB | None | 0 0
  1. UNHANDLED EXCEPTION (2012-08-03 15:48:53.045588)
  2. Working directory: /opt/noc
  3. <type 'exceptions.NameError'>
  4. global name 'UserAccess' is not defined
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/sa/models/managedobjectselector.py (Line: 204)
  8. Function: objects_for_user
  9. 197 """
  10. 198 Returns queryset containing selector objects accessible to user,
  11. 199 optionally restricted to ones having scripts
  12. 200 :param user: User
  13. 201 :param scripts: optional list of scripts
  14. 202 :return:
  15. 203 """
  16. 204 ==> q = UserAccess.Q(user)
  17. 205 if scripts:
  18. 206 q &= Q(profile_name__in=self.scripts_profiles(scripts))
  19. 207 return self.managed_objects.filter(q)
  20. 208
  21. 209 @classmethod
  22. 210 def resolve_expression(cls, s):
  23. Variables:
  24. self = <ManagedObjectSelector: MEN_MPLS_Backbone>
  25. user = <User: iz>
  26. scripts = ['commands']
  27. ------------------------------------------------------------------------
  28. File: /opt/noc/sa/apps/runsnippet/views.py (Line: 149)
  29. Function: view_snippet
  30. 142 snippet.effective_permission_name)):
  31. 143 return self.response_forbidden("Forbidden")
  32. 144 vars = snippet.vars
  33. 145 has_vars = any([v for v in vars if vars[v]["type"] not in (
  34. 146 "internal", "hidden")])
  35. 147 map_task = self.get_map_script(snippet)
  36. 148 objects = list(snippet.selector.objects_for_user(request.user,
  37. 149 ==> [map_task]))
  38. 150 form = None
  39. 151 if request.POST:
  40. 152 objects = ManagedObject.objects.filter(id__in=[
  41. 153 int(n[4:]) for n in request.POST.keys()
  42. 154 if n.startswith("OBJ:") or n.startswith("CFM:")])
  43. 155 data = None
  44. Variables:
  45. 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'}}
  46. self = <noc.sa.apps.runsnippet.views.RunSnippetApplication object at 0x808998a10>
  47. request = <WSGIRequest
  48. GET:<QueryDict: {}>,
  49. POST:<QueryDict: {}>,
  50. COOKIES:{'csrftoken': '15fc69f1ce3ad129e1695ed1affac5e2',
  51. 'sessionid': 'ea43713788bea92af05c2f2957188983'},
  52. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  53. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  54. 'HTTP_ACCEPT_LANGUAGE': 'ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3',
  55. 'HTTP_CONNECTION': 'close',
  56. 'HTTP_COOKIE': 'csrftoken=15fc69f1ce3ad129e1695ed1affac5e2; sessionid=ea43713788bea92af05c2f2957188983',
  57. 'HTTP_DNT': '1',
  58. 'HTTP_HOST': '127.0.0.1:8000',
  59. 'HTTP_REFERER': 'http://noc/sa/runsnippet/',
  60. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1',
  61. 'PATH_INFO': u'/sa/runsnippet/10/',
  62. 'QUERY_STRING': '',
  63. 'REMOTE_ADDR': '127.0.0.1',
  64. 'REQUEST_METHOD': 'GET',
  65. 'SCRIPT_NAME': u'',
  66. 'SERVER_NAME': '127.0.0.1',
  67. 'SERVER_PORT': '8000',
  68. 'SERVER_PROTOCOL': 'HTTP/1.0',
  69. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x8040f25d0>,
  70. 'wsgi.input': <_io.BytesIO object at 0x80963fd10>,
  71. 'wsgi.multiprocess': True,
  72. 'wsgi.multithread': False,
  73. 'wsgi.run_once': False,
  74. 'wsgi.url_scheme': 'http',
  75. 'wsgi.version': (1, 0)}>
  76. snippet = <CommandSnippet: Create_vfi>
  77. has_vars = True
  78. map_task = 'commands'
  79. v = u'vpn_id'
  80. snippet_id = u'10'
  81. ------------------------------------------------------------------------
  82. File: /opt/noc/lib/app/site.py (Line: 226)
  83. Function: inner
  84. 219 for k, v in request.POST.lists())
  85. 220 elif request.method == "GET":
  86. 221 a = dict((k, v[0] if len(v) == 1 else v)
  87. 222 for k, v in request.GET.lists())
  88. 223 logging.debug("API %s %s %s" % (request.method,
  89. 224 request.path, a))
  90. 225 # Call handler
  91. 226 ==> r = v(request, *args, **kwargs)
  92. 227 # Dump SQL statements
  93. 228 if self.log_sql_statements:
  94. 229 from django.db import connections
  95. 230 tsc = 0
  96. 231 sc = defaultdict(int)
  97. 232 for conn in connections.all():
  98. Variables:
  99. args = ()
  100. 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>>}
  101. Form = <class 'django.forms.forms.Form'>
  102. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  103. self = <noc.lib.app.site.Site object at 0x8063821d0>
  104. v = <bound method RunSnippetApplication.view_snippet of <noc.sa.apps.runsnippet.views.RunSnippetApplication object at 0x808998a10>>
  105. request = <WSGIRequest
  106. GET:<QueryDict: {}>,
  107. POST:<QueryDict: {}>,
  108. COOKIES:{'csrftoken': '15fc69f1ce3ad129e1695ed1affac5e2',
  109. 'sessionid': 'ea43713788bea92af05c2f2957188983'},
  110. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  111. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  112. 'HTTP_ACCEPT_LANGUAGE': 'ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3',
  113. 'HTTP_CONNECTION': 'close',
  114. 'HTTP_COOKIE': 'csrftoken=15fc69f1ce3ad129e1695ed1affac5e2; sessionid=ea43713788bea92af05c2f2957188983',
  115. 'HTTP_DNT': '1',
  116. 'HTTP_HOST': '127.0.0.1:8000',
  117. 'HTTP_REFERER': 'http://noc/sa/runsnippet/',
  118. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1',
  119. 'PATH_INFO': u'/sa/runsnippet/10/',
  120. 'QUERY_STRING': '',
  121. 'REMOTE_ADDR': '127.0.0.1',
  122. 'REQUEST_METHOD': 'GET',
  123. 'SCRIPT_NAME': u'',
  124. 'SERVER_NAME': '127.0.0.1',
  125. 'SERVER_PORT': '8000',
  126. 'SERVER_PROTOCOL': 'HTTP/1.0',
  127. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x8040f25d0>,
  128. 'wsgi.input': <_io.BytesIO object at 0x80963fd10>,
  129. 'wsgi.multiprocess': True,
  130. 'wsgi.multithread': False,
  131. 'wsgi.run_once': False,
  132. 'wsgi.url_scheme': 'http',
  133. 'wsgi.version': (1, 0)}>
  134. to_log_api_call = False
  135. InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  136. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  137. kwargs = {'snippet_id': u'10'}
  138. app = <noc.sa.apps.runsnippet.views.RunSnippetApplication object at 0x808998a10>
  139. ------------------------------------------------------------------------
  140. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement