Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2012-12-19 14:19:16,667 UNHANDLED EXCEPTION (2012-12-19 14:19:16.662768)
- Working directory: /opt/noc
- <class 'mongoengine.base.ValidationError'>
- Unable to dereference <class 'noc.inv.models.interface.Interface'>:4eddc783f3b6825b8c002cdc
- 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.macdb.MACDB'>
- instance = <MACDB: 00:22:64:A0:6B:34>
- self = <noc.lib.nosql.PlainReferenceField object at 0x80784c950>
- value = ObjectId('4eddc783f3b6825b8c002cdc')
- v = None
- ------------------------------------------------------------------------
- File: /opt/noc/inv/models/macdb.py (Line: 67)
- Function: submit
- 60 timestamp = datetime.datetime.now()
- 61 managed_object = interface.managed_object
- 62 mac = MAC(mac)
- 63 vcd = vc_domain.id if vc_domain else None
- 64 m = MACDB.objects.filter(mac=mac, vc_domain=vcd).first()
- 65 if m:
- 66 if (managed_object != m.managed_object or
- 67 ==> interface != m.interface or vlan != m.vlan):
- 68 # Database change, write history
- 69 MACLog(
- 70 timestamp=m.last_changed,
- 71 mac=mac,
- 72 vc_domain_name=vc_domain.name if vc_domain else None,
- 73 vlan=m.vlan,
- Variables:
- vcd = 16
- timestamp = datetime.datetime(2012, 12, 19, 14, 19, 16, 658053)
- vlan = 831
- m = <MACDB: 00:22:64:A0:6B:34>
- managed_object = <ManagedObject: cat->
- mac = '00:22:64:A0:6B:34'
- vc_domain = <VCDomain: NN>
- interface = <Interface: cat-: Gi 0/13>
- cls = <class 'noc.inv.models.macdb.MACDB'>
- ------------------------------------------------------------------------
- File: /opt/noc/inv/discovery/reports/macreport.py (Line: 32)
- Function: submit
- 25 if not self.enabled:
- 26 return
- 27 iface = self.get_interface(managed_object, if_name)
- 28 if not iface:
- 29 return # Not found
- 30 if not iface.profile.mac_discovery:
- 31 return # Disabled discovery
- 32 ==> if MACDB.submit(mac, vc_domain, vlan, iface):
- 33 self.info("MAC %s. VC Domain: %s, VLAN %d at %s" % (
- 34 mac,
- 35 vc_domain.name if vc_domain else None,
- 36 vlan, if_name))
- 37 self.changed += [(mac, vlan, iface)]
- 38
- Variables:
- iface = <Interface: cat-: Gi 0/13>
- vc_domain = <VCDomain: NN>
- self = <noc.inv.discovery.reports.macreport.MACReport object at 0x808950810>
- vlan = 831
- managed_object = <ManagedObject: cat->
- if_name = 'Gi 0/13'
- mac = '00:22:64:A0:6B:34'
- ------------------------------------------------------------------------
- File: /opt/noc/inv/discovery/jobs/mac_discovery.py (Line: 57)
- Function: handler
- 50 if (v["type"] == "D" and v["interfaces"] and
- 51 v["mac"] not in dups):
- 52 self.report.submit(
- 53 mac=v["mac"],
- 54 vc_domain=vc_domain,
- 55 vlan=v["vlan_id"],
- 56 managed_object=object,
- 57 ==> if_name=v["interfaces"][0]
- 58 )
- 59 self.report.send()
- 60 return True
- 61
- 62 @classmethod
- 63 def initial_submit_queryset(cls):
- Variables:
- object = <ManagedObject: cat->
- dups = set(['00:11:20:E7:C2:78', '00:11:93:D5:33:C0'])
- vc_domain = <VCDomain: NN>
- self = <noc.inv.discovery.jobs.mac_discovery.MACDiscoveryJob object at 0x80895b750>
- vlan = 4091
- mac = '98:4B:E1:6B:36:7C'
- result = [{'mac': '00:00:21:00:7B:69', ...
- v = {'mac': '00:22:64:A0:6B:34', 'type': 'D', 'interfaces': ['Gi 0/13'], 'vlan_id': 831}
- seen = {'2C:27:D7:2E:5C:4F': 46, ...
- ------------------------------------------------------------------------
- File: /opt/noc/lib/scheduler/scheduler.py (Line: 242)
- Function: _job_wrapper
- 235 t.start()
- 236 else:
- 237 return self._job_wrapper(job, **kwargs)
- 238
- 239 def _job_wrapper(self, job, **kwargs):
- 240 tb = None
- 241 try:
- 242 ==> r = job.handler(**kwargs)
- 243 except Exception:
- 244 error_report()
- 245 job.on_exception()
- 246 s = job.S_EXCEPTION
- 247 tb = get_traceback()
- 248 else:
- Variables:
- job = <noc.inv.discovery.jobs.mac_discovery.MACDiscoveryJob object at 0x80895b750>
- tb = None
- self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x804f5fe90>
- kwargs = {'object': <ManagedObject: cat->, 'result': [{'mac':...
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement