Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2012-08-08 15:20:04,606 UNHANDLED EXCEPTION (2012-08-08 15:20:04.600308)
- Working directory: /usr/local/noc
- <class 'noc.vc.models.MissedLabelException'>
- L2 required
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /usr/local/noc/vc/models.py (Line: 320)
- Function: save
- 313 """
- 314 Enforce additional checks
- 315 """
- 316 if (self.l1 < self.vc_domain.type.label1_min or
- 317 self.l1 > self.vc_domain.type.label1_max):
- 318 raise InvalidLabelException("Invalid value for L1")
- 319 if self.vc_domain.type.min_labels > 1 and not self.l2:
- 320 ==> raise MissedLabelException("L2 required")
- 321 if (self.vc_domain.type.min_labels > 1 and
- 322 not (self.vc_domain.type.label2_min <= self.l2 <= self.vc_domain.type.label2_max)):
- 323 raise InvalidLabelException("Invalid value for L2")
- 324 # Format name
- 325 if self.name:
- 326 self.name = self.convert_name(self.name)
- Variables:
- self = <VC: Gorkovsky 3: DEFAULT-VLAN>
- ------------------------------------------------------------------------
- File: /usr/local/noc/vc/apps/vc/views.py (Line: 108)
- Function: api_bulk_import
- 101 def api_bulk_import(self, request, vc_domain, items):
- 102 n = 0
- 103 for i in items:
- 104 if not VC.objects.filter(vc_domain=vc_domain,
- 105 l1=i["l1"], l2=i["l2"]).exists():
- 106 # Add only not-existing
- 107 VC(vc_domain=vc_domain, l1=i["l1"], l2=i["l2"],
- 108 ==> name=i["name"], description=i["description"]).save()
- 109 n += 1
- 110 return {
- 111 "status": True,
- 112 "imported": n
- 113 }
- 114
- Variables:
- i = {'l1': 3, 'l2': 0, 'description': '', 'name': 'DEFAULT-VLAN'}
- items = [{'l1': 3, 'l2': 0, 'description': '', 'name': 'DEFAULT-VLAN'}, {'l1': 5, 'l2': 0, 'description': '', 'name': '109991025'}, {'l1
- ': 9, 'l2': 0, 'description': '', 'name': '10999112825'}, {'l1': 10, 'l2': 0, 'description': '', 'name': '10301291'}, {'l1': 13, 'l2': 0, 'description'
- : '', 'name': '103012912925'}, {'l1': 14, 'l2': 0, 'description': '', 'name': '1030130125'},
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement