Advertisement
Guest User

Untitled

a guest
Sep 17th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.64 KB | None | 0 0
  1. UNHANDLED EXCEPTION (2012-09-17 12:36:03.852800)
  2. Working directory: /opt/noc
  3. <class 'django.db.utils.DatabaseError'>
  4. column reference "prefix" is ambiguous
  5. LINE 1: ...refix"."afi" = '4' AND T3."id" IS NOT NULL AND ((prefix >>=...
  6. ^
  7.  
  8. START OF TRACEBACK
  9. ------------------------------------------------------------------------
  10. File: /opt/noc/contrib/lib/django/db/backends/postgresql_psycopg2/base.py (Line: 52)
  11. Function: execute
  12. 45 """
  13. 46
  14. 47 def __init__(self, cursor):
  15. 48 self.cursor = cursor
  16. 49
  17. 50 def execute(self, query, args=None):
  18. 51 try:
  19. 52 ==> return self.cursor.execute(query, args)
  20. 53 except Database.IntegrityError, e:
  21. 54 raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2]
  22. 55 except Database.DatabaseError, e:
  23. 56 raise utils.DatabaseError, utils.DatabaseError(*tuple(e)), sys.exc_info()[2]
  24. 57
  25. 58 def executemany(self, query, args):
  26. Variables:
  27. query = u'SELECT "ip_prefix"."id", "ip_prefix"."parent_id", "ip_prefix"."vrf_id", "ip_prefix"."afi", "ip_prefix"."prefix", "ip_prefix"."asn_id", "ip_prefix"."vc_id", "ip_prefix"."description", "ip_prefix"."tags", "ip_prefix"."tt", "ip_prefix"."style_id", "ip_prefix"."state_id", "ip_prefix"."allocated_till", "ip_prefix"."ipv6_transition_id" FROM "ip_prefix" INNER JOIN "ip_prefix" T3 ON ("ip_prefix"."parent_id" = T3."id") WHERE ("ip_prefix"."vrf_id" IN (SELECT U0."id" FROM "ip_vrf" U0 WHERE (U0."vrf_group_id" = %s AND NOT (U0."id" = %s ))) AND "ip_prefix"."afi" = %s AND T3."id" IS NOT NULL AND ((prefix >>= \'10.0.0.0/25\') OR (prefix <<= \'10.0.0.0/25\')))'
  28. self = <django.db.backends.postgresql_psycopg2.base.CursorWrapper object at 0x5a74e50>
  29. args = (2, 2, u'4')
  30. e = ProgrammingError('column reference "prefix" is ambiguous\nLINE 1: ...refix"."afi" = \'4\' AND T3."id" IS NOT NULL AND ((prefix >>=...\n ^\n',)
  31. ------------------------------------------------------------------------
  32. File: /opt/noc/contrib/lib/django/db/backends/util.py (Line: 40)
  33. Function: execute
  34. 33
  35. 34 class CursorDebugWrapper(CursorWrapper):
  36. 35
  37. 36 def execute(self, sql, params=()):
  38. 37 self.set_dirty()
  39. 38 start = time()
  40. 39 try:
  41. 40 ==> return self.cursor.execute(sql, params)
  42. 41 finally:
  43. 42 stop = time()
  44. 43 duration = stop - start
  45. 44 sql = self.db.ops.last_executed_query(self.cursor, sql, params)
  46. 45 self.db.queries.append({
  47. 46 'sql': sql,
  48. Variables:
  49. self = <django.db.backends.util.CursorDebugWrapper object at 0x5a74810>
  50. stop = 1347870963.852708
  51. start = 1347870963.852099
  52. params = (2, 2, u'4')
  53. sql = 'SELECT "ip_prefix"."id", "ip_prefix"."parent_id", "ip_prefix"."vrf_id", "ip_prefix"."afi", "ip_prefix"."prefix", "ip_prefix"."asn_id", "ip_prefix"."vc_id", "ip_prefix"."description", "ip_prefix"."tags", "ip_prefix"."tt", "ip_prefix"."style_id", "ip_prefix"."state_id", "ip_prefix"."allocated_till", "ip_prefix"."ipv6_transition_id" FROM "ip_prefix" INNER JOIN "ip_prefix" T3 ON ("ip_prefix"."parent_id" = T3."id") WHERE ("ip_prefix"."vrf_id" IN (SELECT U0."id" FROM "ip_vrf" U0 WHERE (U0."vrf_group_id" = 2 AND NOT (U0."id" = 2 ))) AND "ip_prefix"."afi" = \'4\' AND T3."id" IS NOT NULL AND ((prefix >>= \'10.0.0.0/25\') OR (prefix <<= \'10.0.0.0/25\')))'
  54. duration = 0.0006091594696044922
  55. ------------------------------------------------------------------------
  56. File: /opt/noc/contrib/lib/django/db/models/sql/compiler.py (Line: 818)
  57. Function: execute_sql
  58. 811 except EmptyResultSet:
  59. 812 if result_type == MULTI:
  60. 813 return empty_iter()
  61. 814 else:
  62. 815 return
  63. 816
  64. 817 cursor = self.connection.cursor()
  65. 818 ==> cursor.execute(sql, params)
  66. 819
  67. 820 if not result_type:
  68. 821 return cursor
  69. 822 if result_type == SINGLE:
  70. 823 if self.query.ordering_aliases:
  71. 824 return cursor.fetchone()[:-len(self.query.ordering_aliases)]
  72. Variables:
  73. cursor = <django.db.backends.util.CursorDebugWrapper object at 0x5a74810>
  74. self = <django.db.models.sql.compiler.SQLCompiler object at 0x5a74b10>
  75. params = (2, 2, u'4')
  76. result_type = 'multi'
  77. sql = u'SELECT "ip_prefix"."id", "ip_prefix"."parent_id", "ip_prefix"."vrf_id", "ip_prefix"."afi", "ip_prefix"."prefix", "ip_prefix"."asn_id", "ip_prefix"."vc_id", "ip_prefix"."description", "ip_prefix"."tags", "ip_prefix"."tt", "ip_prefix"."style_id", "ip_prefix"."state_id", "ip_prefix"."allocated_till", "ip_prefix"."ipv6_transition_id" FROM "ip_prefix" INNER JOIN "ip_prefix" T3 ON ("ip_prefix"."parent_id" = T3."id") WHERE ("ip_prefix"."vrf_id" IN (SELECT U0."id" FROM "ip_vrf" U0 WHERE (U0."vrf_group_id" = %s AND NOT (U0."id" = %s ))) AND "ip_prefix"."afi" = %s AND T3."id" IS NOT NULL AND ((prefix >>= \'10.0.0.0/25\') OR (prefix <<= \'10.0.0.0/25\')))'
  78. ------------------------------------------------------------------------
  79. File: /opt/noc/contrib/lib/django/db/models/sql/compiler.py (Line: 763)
  80. Function: results_iter
  81. 756 fields = None
  82. 757 has_aggregate_select = bool(self.query.aggregate_select)
  83. 758 # Set transaction dirty if we're using SELECT FOR UPDATE to ensure
  84. 759 # a subsequent commit/rollback is executed, so any database locks
  85. 760 # are released.
  86. 761 if self.query.select_for_update and transaction.is_managed(self.using):
  87. 762 transaction.set_dirty(self.using)
  88. 763 ==> for rows in self.execute_sql(MULTI):
  89. 764 for row in rows:
  90. 765 if resolve_columns:
  91. 766 if fields is None:
  92. 767 # We only set this up here because
  93. 768 # related_select_fields isn't populated until
  94. 769 # execute_sql() has been called.
  95. Variables:
  96. fields = None
  97. self = <django.db.models.sql.compiler.SQLCompiler object at 0x5a74b10>
  98. has_aggregate_select = False
  99. resolve_columns = False
  100. ------------------------------------------------------------------------
  101. File: /opt/noc/contrib/lib/django/db/models/query.py (Line: 291)
  102. Function: iterator
  103. 284 # Cache db and model outside the loop
  104. 285 db = self.db
  105. 286 model = self.model
  106. 287 compiler = self.query.get_compiler(using=db)
  107. 288 if fill_cache:
  108. 289 klass_info = get_klass_info(model, max_depth=max_depth,
  109. 290 requested=requested, only_load=only_load)
  110. 291 ==> for row in compiler.results_iter():
  111. 292 if fill_cache:
  112. 293 obj, _ = get_cached_row(row, index_start, db, klass_info,
  113. 294 offset=len(aggregate_select))
  114. 295 else:
  115. 296 if skip:
  116. 297 row_data = row[index_start:aggregate_start]
  117. Variables:
  118. requested = None
  119. fill_cache = False
  120. aggregate_select = []
  121. fields = [<django.db.models.fields.AutoField: id>, <django.db.models.fields.related.ForeignKey: parent>, <django.db.models.fields.related.ForeignKey: vrf>, <django.db.models.fields.CharField: afi>, <noc.lib.fields.CIDRField: prefix>, <django.db.models.fields.related.ForeignKey: asn>, <django.db.models.fields.related.ForeignKey: vc>, <django.db.models.fields.TextField: description>, <noc.lib.fields.AutoCompleteTagsField: tags>, <django.db.models.fields.IntegerField: tt>, <django.db.models.fields.related.ForeignKey: style>, <django.db.models.fields.related.ForeignKey: state>, <django.db.models.fields.DateField: allocated_till>, <django.db.models.fields.related.OneToOneField: ipv6_transition>]
  122. skip = None
  123. self = []
  124. load_fields = []
  125. db = 'default'
  126. index_start = 0
  127. extra_select = []
  128. aggregate_start = 14
  129. model = <class 'noc.ip.models.prefix.Prefix'>
  130. only_load = {}
  131. max_depth = 5
  132. compiler = <django.db.models.sql.compiler.SQLCompiler object at 0x5a74b10>
  133. ------------------------------------------------------------------------
  134. File: /opt/noc/contrib/lib/django/db/models/query.py (Line: 875)
  135. Function: _fill_cache
  136. 868 """
  137. 869 Fills the result cache with 'num' more entries (or until the results
  138. 870 iterator is exhausted).
  139. 871 """
  140. 872 if self._iter:
  141. 873 try:
  142. 874 for i in range(num or ITER_CHUNK_SIZE):
  143. 875 ==> self._result_cache.append(self._iter.next())
  144. 876 except StopIteration:
  145. 877 self._iter = None
  146. 878
  147. 879 def _next_is_sticky(self):
  148. 880 """
  149. 881 Indicates that the next filter call and the one following that should
  150. Variables:
  151. i = 0
  152. self = []
  153. num = None
  154. ------------------------------------------------------------------------
  155. File: /opt/noc/contrib/lib/django/db/models/query.py (Line: 118)
  156. Function: _result_iter
  157. 111 upper = len(self._result_cache)
  158. 112 while pos < upper:
  159. 113 yield self._result_cache[pos]
  160. 114 pos = pos + 1
  161. 115 if not self._iter:
  162. 116 raise StopIteration
  163. 117 if len(self._result_cache) <= pos:
  164. 118 ==> self._fill_cache()
  165. 119
  166. 120 def __nonzero__(self):
  167. 121 if self._prefetch_related_lookups and not self._prefetch_done:
  168. 122 # We need all the results in order to be able to do the prefetch
  169. 123 # in one go. To minimize code duplication, we use the __len__
  170. 124 # code path which also forces this, and also does the prefetch
  171. Variables:
  172. upper = 0
  173. self = []
  174. pos = 0
  175. ------------------------------------------------------------------------
  176. File: /opt/noc/contrib/lib/django/db/models/query.py (Line: 130)
  177. Function: __nonzero__
  178. 123 # in one go. To minimize code duplication, we use the __len__
  179. 124 # code path which also forces this, and also does the prefetch
  180. 125 len(self)
  181. 126
  182. 127 if self._result_cache is not None:
  183. 128 return bool(self._result_cache)
  184. 129 try:
  185. 130 ==> iter(self).next()
  186. 131 except StopIteration:
  187. 132 return False
  188. 133 return True
  189. 134
  190. 135 def __contains__(self, val):
  191. 136 # The 'in' operator works without this method, due to __iter__. This
  192. Variables:
  193. self = []
  194. ------------------------------------------------------------------------
  195. File: /opt/noc/ip/apps/ipam/views.py (Line: 487)
  196. Function: clean_prefix
  197. 480 p = Prefix.objects.filter(
  198. 481 vrf__in=vrf.vrf_group.vrf_set.exclude(id=vrf.id),
  199. 482 afi=afi,
  200. 483 parent__isnull=False
  201. 484 ).filter(
  202. 485 SQL("prefix >>= '%s'" % prefix) |
  203. 486 SQL("prefix <<= '%s'" % prefix))
  204. 487 ==> if p:
  205. 488 raise ValidationError(_("Prefix %s is already exists in vrf %s") % (p[0].prefix, p[0].vrf))
  206. 489 return prefix
  207. 490
  208. 491 def clean_dual_stack_prefix(self):
  209. 492 ds_prefix = self.cleaned_data["dual_stack_prefix"]
  210. 493 ds_afi = "6" if afi == "4" else "4"
  211. Variables:
  212. afi = u'4'
  213. self = <noc.ip.apps.ipam.views.AddPrefixForm object at 0x5a7a610>
  214. request = <WSGIRequest
  215. path:/ip/ipam/2/4/10.0.0.0/24/add_prefix/,
  216. GET:<QueryDict: {}>,
  217. POST:<QueryDict: {u'style': [u''], u'description': [u'asd'], u'_save': [u'Save'], u'tags': [u''], u'tt': [u''], u'state': [u'1'], u'prefix': [u'10.0.0.0/25'], u'asn': [u'1'], u'dual_stack_prefix': [u'']}>,
  218. COOKIES:{'__utma': '184558463.131414743.1334561811.1336113233.1339049840.6',
  219. '__utmz': '184558463.1334561811.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
  220. 'csrftoken': 'dc8ho5Gcgn2EP1xoXN8X3qngZEOibOnD',
  221. 'sessionid': 'ca32cb60307c56fa9d83a04f70df3441'},
  222. META:{'CONTENT_LENGTH': '97',
  223. 'CONTENT_TYPE': 'application/x-www-form-urlencoded',
  224. 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  225. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  226. 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
  227. 'HTTP_CONNECTION': 'close',
  228. 'HTTP_COOKIE': '__utma=184558463.131414743.1334561811.1336113233.1339049840.6; __utmz=184558463.1334561811.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); sessionid=ca32cb60307c56fa9d83a04f70df3441; csrftoken=dc8ho5Gcgn2EP1xoXN8X3qngZEOibOnD',
  229. 'HTTP_DNT': '1',
  230. 'HTTP_HOST': '127.0.0.1:8000',
  231. 'HTTP_REFERER': 'http://noc.gnc.am/ip/ipam/2/4/10.0.0.0/24/add_prefix/',
  232. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/18.0 Firefox/18.0 SeaMonkey/2.15a1 Lightning/2.0a1',
  233. 'PATH_INFO': u'/ip/ipam/2/4/10.0.0.0/24/add_prefix/',
  234. 'QUERY_STRING': '',
  235. 'REMOTE_ADDR': '127.0.0.1',
  236. 'REQUEST_METHOD': 'POST',
  237. 'SCRIPT_NAME': u'',
  238. 'SERVER_NAME': '127.0.0.1',
  239. 'SERVER_PORT': '8000',
  240. 'SERVER_PROTOCOL': 'HTTP/1.0',
  241. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x2ed0300>,
  242. 'wsgi.input': <_io.BytesIO object at 0x58b0f50>,
  243. 'wsgi.multiprocess': True,
  244. 'wsgi.multithread': False,
  245. 'wsgi.run_once': False,
  246. 'wsgi.url_scheme': 'http',
  247. 'wsgi.version': (1, 0)}>
  248. p = []
  249. prefix = u'10.0.0.0/25'
  250. vrf = <VRF: GNC-Management>
  251. ------------------------------------------------------------------------
  252. File: /opt/noc/contrib/lib/django/forms/forms.py (Line: 290)
  253. Function: _clean_fields
  254. 283 if isinstance(field, FileField):
  255. 284 initial = self.initial.get(name, field.initial)
  256. 285 value = field.clean(value, initial)
  257. 286 else:
  258. 287 value = field.clean(value)
  259. 288 self.cleaned_data[name] = value
  260. 289 if hasattr(self, 'clean_%s' % name):
  261. 290 ==> value = getattr(self, 'clean_%s' % name)()
  262. 291 self.cleaned_data[name] = value
  263. 292 except ValidationError, e:
  264. 293 self._errors[name] = self.error_class(e.messages)
  265. 294 if name in self.cleaned_data:
  266. 295 del self.cleaned_data[name]
  267. 296
  268. Variables:
  269. field = <django.forms.fields.CharField object at 0x5a6cb90>
  270. self = <noc.ip.apps.ipam.views.AddPrefixForm object at 0x5a7a610>
  271. name = 'prefix'
  272. value = u'10.0.0.0/25'
  273. ------------------------------------------------------------------------
  274. File: /opt/noc/contrib/lib/django/forms/forms.py (Line: 270)
  275. Function: full_clean
  276. 263 if not self.is_bound: # Stop further processing.
  277. 264 return
  278. 265 self.cleaned_data = {}
  279. 266 # If the form is permitted to be empty, and none of the form data has
  280. 267 # changed from the initial data, short circuit any validation.
  281. 268 if self.empty_permitted and not self.has_changed():
  282. 269 return
  283. 270 ==> self._clean_fields()
  284. 271 self._clean_form()
  285. 272 self._post_clean()
  286. 273 if self._errors:
  287. 274 del self.cleaned_data
  288. 275
  289. 276 def _clean_fields(self):
  290. Variables:
  291. self = <noc.ip.apps.ipam.views.AddPrefixForm object at 0x5a7a610>
  292. ------------------------------------------------------------------------
  293. File: /opt/noc/contrib/lib/django/forms/forms.py (Line: 115)
  294. Function: _get_errors
  295. 108 except KeyError:
  296. 109 raise KeyError('Key %r not found in Form' % name)
  297. 110 return BoundField(self, field, name)
  298. 111
  299. 112 def _get_errors(self):
  300. 113 "Returns an ErrorDict for the data provided for the form"
  301. 114 if self._errors is None:
  302. 115 ==> self.full_clean()
  303. 116 return self._errors
  304. 117 errors = property(_get_errors)
  305. 118
  306. 119 def is_valid(self):
  307. 120 """
  308. 121 Returns True if the form has no errors. Otherwise, False. If errors are
  309. Variables:
  310. self = <noc.ip.apps.ipam.views.AddPrefixForm object at 0x5a7a610>
  311. ------------------------------------------------------------------------
  312. File: /opt/noc/contrib/lib/django/forms/forms.py (Line: 124)
  313. Function: is_valid
  314. 117 errors = property(_get_errors)
  315. 118
  316. 119 def is_valid(self):
  317. 120 """
  318. 121 Returns True if the form has no errors. Otherwise, False. If errors are
  319. 122 being ignored, returns False.
  320. 123 """
  321. 124 ==> return self.is_bound and not bool(self.errors)
  322. 125
  323. 126 def add_prefix(self, field_name):
  324. 127 """
  325. 128 Returns the field name with a prefix appended, if this Form has a
  326. 129 prefix set.
  327. 130
  328. Variables:
  329. self = <noc.ip.apps.ipam.views.AddPrefixForm object at 0x5a7a610>
  330. ------------------------------------------------------------------------
  331. File: /opt/noc/ip/apps/ipam/views.py (Line: 520)
  332. Function: view_add_prefix
  333. 513 (afi == "6" and not vrf.afi_ipv6)):
  334. 514 return self.response_forbidden("Invalid AFI")
  335. 515 parent = self.get_object_or_404(Prefix, vrf=vrf, afi=afi, prefix=prefix)
  336. 516 # Process input
  337. 517 form_class = get_form_class()
  338. 518 if request.POST:
  339. 519 form = form_class(request.POST)
  340. 520 ==> if form.is_valid():
  341. 521 # Create prefix
  342. 522 p = Prefix(vrf=vrf, afi=afi,
  343. 523 prefix=form.cleaned_data["prefix"].strip(),
  344. 524 state=form.cleaned_data["state"],
  345. 525 asn=form.cleaned_data["asn"],
  346. 526 description=form.cleaned_data["description"],
  347. Variables:
  348. vrf = <VRF: GNC-Management>
  349. form = <noc.ip.apps.ipam.views.AddPrefixForm object at 0x5a7a610>
  350. parent = repr() failed
  351. get_form_class = <function get_form_class at 0x5a24c80>
  352. request = <WSGIRequest
  353. path:/ip/ipam/2/4/10.0.0.0/24/add_prefix/,
  354. GET:<QueryDict: {}>,
  355. POST:<QueryDict: {u'style': [u''], u'description': [u'asd'], u'_save': [u'Save'], u'tags': [u''], u'tt': [u''], u'state': [u'1'], u'prefix': [u'10.0.0.0/25'], u'asn': [u'1'], u'dual_stack_prefix': [u'']}>,
  356. COOKIES:{'__utma': '184558463.131414743.1334561811.1336113233.1339049840.6',
  357. '__utmz': '184558463.1334561811.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
  358. 'csrftoken': 'dc8ho5Gcgn2EP1xoXN8X3qngZEOibOnD',
  359. 'sessionid': 'ca32cb60307c56fa9d83a04f70df3441'},
  360. META:{'CONTENT_LENGTH': '97',
  361. 'CONTENT_TYPE': 'application/x-www-form-urlencoded',
  362. 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  363. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  364. 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
  365. 'HTTP_CONNECTION': 'close',
  366. 'HTTP_COOKIE': '__utma=184558463.131414743.1334561811.1336113233.1339049840.6; __utmz=184558463.1334561811.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); sessionid=ca32cb60307c56fa9d83a04f70df3441; csrftoken=dc8ho5Gcgn2EP1xoXN8X3qngZEOibOnD',
  367. 'HTTP_DNT': '1',
  368. 'HTTP_HOST': '127.0.0.1:8000',
  369. 'HTTP_REFERER': 'http://noc.gnc.am/ip/ipam/2/4/10.0.0.0/24/add_prefix/',
  370. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/18.0 Firefox/18.0 SeaMonkey/2.15a1 Lightning/2.0a1',
  371. 'PATH_INFO': u'/ip/ipam/2/4/10.0.0.0/24/add_prefix/',
  372. 'QUERY_STRING': '',
  373. 'REMOTE_ADDR': '127.0.0.1',
  374. 'REQUEST_METHOD': 'POST',
  375. 'SCRIPT_NAME': u'',
  376. 'SERVER_NAME': '127.0.0.1',
  377. 'SERVER_PORT': '8000',
  378. 'SERVER_PROTOCOL': 'HTTP/1.0',
  379. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x2ed0300>,
  380. 'wsgi.input': <_io.BytesIO object at 0x58b0f50>,
  381. 'wsgi.multiprocess': True,
  382. 'wsgi.multithread': False,
  383. 'wsgi.run_once': False,
  384. 'wsgi.url_scheme': 'http',
  385. 'wsgi.version': (1, 0)}>
  386. prefix = u'10.0.0.0/24'
  387. form_class = <class 'noc.ip.apps.ipam.views.AddPrefixForm'>
  388. vrf_id = u'2'
  389. self = <noc.ip.apps.ipam.views.IPAMAppplication object at 0x573c710>
  390. afi = u'4'
  391. ------------------------------------------------------------------------
  392. File: /opt/noc/lib/app/site.py (Line: 231)
  393. Function: inner
  394. 224 for k, v in request.POST.lists())
  395. 225 elif request.method == "GET":
  396. 226 a = dict((k, v[0] if len(v) == 1 else v)
  397. 227 for k, v in request.GET.lists())
  398. 228 logging.debug("API %s %s %s" % (request.method,
  399. 229 request.path, a))
  400. 230 # Call handler
  401. 231 ==> r = v(request, *args, **kwargs)
  402. 232 # Dump SQL statements
  403. 233 if self.log_sql_statements:
  404. 234 from django.db import connections
  405. 235 tsc = 0
  406. 236 sc = defaultdict(int)
  407. 237 for conn in connections.all():
  408. Variables:
  409. args = ()
  410. view_map = {'PUT': <bound method IPAMAppplication.view_add_prefix of <noc.ip.apps.ipam.views.IPAMAppplication object at 0x573c710>>, 'POST': <bound method IPAMAppplication.view_add_prefix of <noc.ip.apps.ipam.views.IPAMAppplication object at 0x573c710>>, 'GET': <bound method IPAMAppplication.view_add_prefix of <noc.ip.apps.ipam.views.IPAMAppplication object at 0x573c710>>, 'DELETE': <bound method IPAMAppplication.view_add_prefix of <noc.ip.apps.ipam.views.IPAMAppplication object at 0x573c710>>}
  411. Form = <class 'django.forms.forms.Form'>
  412. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  413. self = <noc.lib.app.site.Site object at 0x3b7fbd0>
  414. v = <bound method IPAMAppplication.view_add_prefix of <noc.ip.apps.ipam.views.IPAMAppplication object at 0x573c710>>
  415. request = <WSGIRequest
  416. path:/ip/ipam/2/4/10.0.0.0/24/add_prefix/,
  417. GET:<QueryDict: {}>,
  418. POST:<QueryDict: {u'style': [u''], u'description': [u'asd'], u'_save': [u'Save'], u'tags': [u''], u'tt': [u''], u'state': [u'1'], u'prefix': [u'10.0.0.0/25'], u'asn': [u'1'], u'dual_stack_prefix': [u'']}>,
  419. COOKIES:{'__utma': '184558463.131414743.1334561811.1336113233.1339049840.6',
  420. '__utmz': '184558463.1334561811.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
  421. 'csrftoken': 'dc8ho5Gcgn2EP1xoXN8X3qngZEOibOnD',
  422. 'sessionid': 'ca32cb60307c56fa9d83a04f70df3441'},
  423. META:{'CONTENT_LENGTH': '97',
  424. 'CONTENT_TYPE': 'application/x-www-form-urlencoded',
  425. 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  426. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  427. 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
  428. 'HTTP_CONNECTION': 'close',
  429. 'HTTP_COOKIE': '__utma=184558463.131414743.1334561811.1336113233.1339049840.6; __utmz=184558463.1334561811.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); sessionid=ca32cb60307c56fa9d83a04f70df3441; csrftoken=dc8ho5Gcgn2EP1xoXN8X3qngZEOibOnD',
  430. 'HTTP_DNT': '1',
  431. 'HTTP_HOST': '127.0.0.1:8000',
  432. 'HTTP_REFERER': 'http://noc.gnc.am/ip/ipam/2/4/10.0.0.0/24/add_prefix/',
  433. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/18.0 Firefox/18.0 SeaMonkey/2.15a1 Lightning/2.0a1',
  434. 'PATH_INFO': u'/ip/ipam/2/4/10.0.0.0/24/add_prefix/',
  435. 'QUERY_STRING': '',
  436. 'REMOTE_ADDR': '127.0.0.1',
  437. 'REQUEST_METHOD': 'POST',
  438. 'SCRIPT_NAME': u'',
  439. 'SERVER_NAME': '127.0.0.1',
  440. 'SERVER_PORT': '8000',
  441. 'SERVER_PROTOCOL': 'HTTP/1.0',
  442. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x2ed0300>,
  443. 'wsgi.input': <_io.BytesIO object at 0x58b0f50>,
  444. 'wsgi.multiprocess': True,
  445. 'wsgi.multithread': False,
  446. 'wsgi.run_once': False,
  447. 'wsgi.url_scheme': 'http',
  448. 'wsgi.version': (1, 0)}>
  449. to_log_api_call = False
  450. InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  451. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  452. kwargs = {'vrf_id': u'2', 'prefix': u'10.0.0.0/24', 'afi': u'4'}
  453. app = <noc.ip.apps.ipam.views.IPAMAppplication object at 0x573c710>
  454. ------------------------------------------------------------------------
  455. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement