Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Syncing noc.objectmodels:
- ERROR:root:UNHANDLED EXCEPTION (2013-12-11 11:23:25.747506)
- Working directory: /opt/noc
- <class 'mongoengine.base.ValidationError'>
- Unable to dereference <class 'noc.inv.models.vendor.Vendor'>:5291f2379297e806893d6b4f
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nosql.py (Line: 103)
- Function: __get__
- 96 # Dereference DBRefs
- 97 if isinstance(value, ObjectId):
- 98 v = self.document_type.objects(id=value).first()
- 99 if v is not None:
- 100 instance._data[self.name] = v
- 101 else:
- 102 raise ValidationError("Unable to dereference %s:%s" % (
- 103 ==> self.document_type, value))
- 104 return super(PlainReferenceField, self).__get__(instance, owner)
- 105
- 106 def to_mongo(self, document):
- 107 if isinstance(document, Document):
- 108 # We need the id from the saved object to create the DBRef
- 109 id_ = document.id
- Variables:
- owner = <class 'noc.inv.models.objectmodel.ObjectModel'>
- instance = <ObjectModel: Arista | Transceiver | 10G | SFP-10G-SRL>
- self = <noc.lib.nosql.PlainReferenceField object at 0x3c7bc50>
- value = ObjectId('5291f2379297e806893d6b4f')
- v = None
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/sync-collections.py (Line: 119)
- Function: sync_item
- 112 # Dereference ref_field__field lookups
- 113 if "__" in i and not i.startswith("__"):
- 114 i, f = i.split("__")
- 115 if i not in self.doc._fields:
- 116 self.die("Invalid lookup field: %s" % i)
- 117 ref = self.doc._fields[i].document_type
- 118 v = self.lookup(ref, f, v)
- 119 ==> cv = getattr(obj, i)
- 120 if cv is None or cv.id != v.id:
- 121 changed = True
- 122 setattr(obj, i, v)
- 123 continue
- 124 # Process fields
- 125 try:
- Variables:
- sk = [{'name': 'Arista | Transceiver | 10G | SFP-10G-SRL'}]
- changed = False
- obj = <ObjectModel: Arista | Transceiver | 10G | SFP-10G-SRL>
- d =
- {'connections': [{'description': 'TX',
- 'direction': 's',
- 'gender': 'f',
- 'name': 'tx',
- 'protocols': ['<10GBASESR'],
- 'type': <ConnectionType: Optical | LC>,
- 'type__name': 'Optical | LC'},
- {'description': 'RX',
- 'direction': 's',
- 'gender': 'f',
- 'name': 'rx',
- 'protocols': ['>10GBASESR'],
- 'type': <ConnectionType: Optical | LC>,
- 'type__name': 'Optical | LC'},
- {'description': 'Chassis connection',
- 'direction': 'o',
- 'gender': 'm',
- 'name': 'in',
- 'protocols': ['TransEth10G'],
- 'type': <ConnectionType: Transceiver | SFP>,
- 'type__name': 'Transceiver | SFP'}],
- 'data': {'asset': {'part_no0': 'SFP-10G-SRL'}},
- 'description': '10GBASE-SRL 50u MMF / 100m SFP+ transceiver',
- 'is_builtin': True,
- 'name': 'Arista | Transceiver | 10G | SFP-10G-SRL',
- 'vendor__code': 'ARISTA'}
- f = 'code'
- i = 'vendor'
- allow_partial = True
- dd =
- {'description': 'Chassis connection',
- 'direction': 'o',
- 'gender': 'm',
- 'name': 'in',
- 'protocols': ['TransEth10G'],
- 'type': <ConnectionType: Transceiver | SFP>,
- 'type__name': 'Transceiver | SFP'}
- created = False
- edoc = <class 'noc.inv.models.objectmodel.ObjectModelConnection'>
- self =
- <noc.main.management.commands.sync-collections.CollectionSync instance at 0x50f1560>
- ii = 'description'
- field = <mongoengine.fields.BooleanField object at 0x3c7bbd0>
- u = 'name'
- vv = 'Transceiver | SFP'
- v = <Vendor: Arista Networks>
- y = 'Chassis connection'
- x = 'description'
- ref = <class 'noc.inv.models.vendor.Vendor'>
- k = {'name': 'Arista | Transceiver | 10G | SFP-10G-SRL'}
- partial = False
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/sync-collections.py (Line: 196)
- Function: sync
- 189 self.unique = set()
- 190 for index in self.doc._meta["unique_indexes"]:
- 191 for f, flag in index:
- 192 self.unique.add(f)
- 193 # Sync items
- 194 retry = []
- 195 for d in self.get_data():
- 196 ==> item_id, to_retry = self.sync_item(d, True)
- 197 try:
- 198 self.builtin_ids.remove(item_id)
- 199 except KeyError:
- 200 pass
- 201 if to_retry:
- 202 retry += [d]
- Variables:
- index = [('name', 1)]
- retry = []
- d =
- {'connections': [{'description': 'TX',
- 'direction': 's',
- 'gender': 'f',
- 'name': 'tx',
- 'protocols': ['<10GBASESR'],
- 'type': <ConnectionType: Optical | LC>,
- 'type__name': 'Optical | LC'},
- {'description': 'RX',
- 'direction': 's',
- 'gender': 'f',
- 'name': 'rx',
- 'protocols': ['>10GBASESR'],
- 'type': <ConnectionType: Optical | LC>,
- 'type__name': 'Optical | LC'},
- {'description': 'Chassis connection',
- 'direction': 'o',
- 'gender': 'm',
- 'name': 'in',
- 'protocols': ['TransEth10G'],
- 'type': <ConnectionType: Transceiver | SFP>,
- 'type__name': 'Transceiver | SFP'}],
- 'data': {'asset': {'part_no0': 'SFP-10G-SRL'}},
- 'description': '10GBASE-SRL 50u MMF / 100m SFP+ transceiver',
- 'is_builtin': True,
- 'name': 'Arista | Transceiver | 10G | SFP-10G-SRL',
- 'vendor__code': 'ARISTA'}
- f = 'name'
- self =
- <noc.main.management.commands.sync-collections.CollectionSync instance at 0x50f1560>
- o = <ObjectModel: Brocade | JetCore | J-FIxGMR4>
- item_id = '527762fb9297e83592a7983a'
- flag = 1
- to_retry = False
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/sync-collections.py (Line: 267)
- Function: handle
- 260 if not a:
- 261 raise CommandError("Invalid collection: %s" % name)
- 262 CollectionSync(*a).sync()
- 263 else:
- 264 # Sync all collections
- 265 for app, collections in self.collections:
- 266 for collection, doc in collections:
- 267 ==> CollectionSync(app, collection, doc).sync()
- 268 except CommandError, why:
- 269 raise CommandError(why)
- 270 except:
- 271 error_report()
- Variables:
- doc = <class 'noc.inv.models.objectmodel.ObjectModel'>
- app = 'inv'
- args = ()
- collection = 'objectmodels'
- self =
- <noc.main.management.commands.sync-collections.Command object at 0x50e9290>
- collections =
- [('vendors', <class 'noc.inv.models.vendor.Vendor'>),
- ('modelinterfaces', <class 'noc.inv.models.modelinterface.ModelInterface'>),
- ('connectiontypes', <class 'noc.inv.models.connectiontype.ConnectionType'>),
- ('connectionrules', <class 'noc.inv.models.connectionrule.ConnectionRule'>),
- ('objectmodels', <class 'noc.inv.models.objectmodel.ObjectModel'>)]
- options =
- {'pythonpath': None, 'settings': None, 'traceback': None, 'verbosity': '1'}
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement