Advertisement
Guest User

Untitled

a guest
Aug 8th, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. 2012-08-08 15:20:04,606 UNHANDLED EXCEPTION (2012-08-08 15:20:04.600308)
  2. Working directory: /usr/local/noc
  3. <class 'noc.vc.models.MissedLabelException'>
  4. L2 required
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /usr/local/noc/vc/models.py (Line: 320)
  8. Function: save
  9. 313 """
  10. 314 Enforce additional checks
  11. 315 """
  12. 316 if (self.l1 < self.vc_domain.type.label1_min or
  13. 317 self.l1 > self.vc_domain.type.label1_max):
  14. 318 raise InvalidLabelException("Invalid value for L1")
  15. 319 if self.vc_domain.type.min_labels > 1 and not self.l2:
  16. 320 ==> raise MissedLabelException("L2 required")
  17. 321 if (self.vc_domain.type.min_labels > 1 and
  18. 322 not (self.vc_domain.type.label2_min <= self.l2 <= self.vc_domain.type.label2_max)):
  19. 323 raise InvalidLabelException("Invalid value for L2")
  20. 324 # Format name
  21. 325 if self.name:
  22. 326 self.name = self.convert_name(self.name)
  23. Variables:
  24. self = <VC: Gorkovsky 3: DEFAULT-VLAN>
  25. ------------------------------------------------------------------------
  26. File: /usr/local/noc/vc/apps/vc/views.py (Line: 108)
  27. Function: api_bulk_import
  28. 101 def api_bulk_import(self, request, vc_domain, items):
  29. 102 n = 0
  30. 103 for i in items:
  31. 104 if not VC.objects.filter(vc_domain=vc_domain,
  32. 105 l1=i["l1"], l2=i["l2"]).exists():
  33. 106 # Add only not-existing
  34. 107 VC(vc_domain=vc_domain, l1=i["l1"], l2=i["l2"],
  35. 108 ==> name=i["name"], description=i["description"]).save()
  36. 109 n += 1
  37. 110 return {
  38. 111 "status": True,
  39. 112 "imported": n
  40. 113 }
  41. 114
  42. Variables:
  43. i = {'l1': 3, 'l2': 0, 'description': '', 'name': 'DEFAULT-VLAN'}
  44. items = [{'l1': 3, 'l2': 0, 'description': '', 'name': 'DEFAULT-VLAN'}, {'l1': 5, 'l2': 0, 'description': '', 'name': '109991025'}, {'l1
  45. ': 9, 'l2': 0, 'description': '', 'name': '10999112825'}, {'l1': 10, 'l2': 0, 'description': '', 'name': '10301291'}, {'l1': 13, 'l2': 0, 'description'
  46. : '', 'name': '103012912925'}, {'l1': 14, 'l2': 0, 'description': '', 'name': '1030130125'},
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement