Advertisement
Guest User

Untitled

a guest
Dec 19th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.23 KB | None | 0 0
  1. 2012-12-19 14:19:16,667 UNHANDLED EXCEPTION (2012-12-19 14:19:16.662768)
  2. Working directory: /opt/noc
  3. <class 'mongoengine.base.ValidationError'>
  4. Unable to dereference <class 'noc.inv.models.interface.Interface'>:4eddc783f3b6825b8c002cdc
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/lib/nosql.py (Line: 103)
  8. Function: __get__
  9. 96 # Dereference DBRefs
  10. 97 if isinstance(value, ObjectId):
  11. 98 v = self.document_type.objects(id=value).first()
  12. 99 if v is not None:
  13. 100 instance._data[self.name] = v
  14. 101 else:
  15. 102 raise ValidationError("Unable to dereference %s:%s" % (
  16. 103 ==> self.document_type, value))
  17. 104 return super(PlainReferenceField, self).__get__(instance, owner)
  18. 105
  19. 106 def to_mongo(self, document):
  20. 107 if isinstance(document, Document):
  21. 108 # We need the id from the saved object to create the DBRef
  22. 109 id_ = document.id
  23. Variables:
  24. owner = <class 'noc.inv.models.macdb.MACDB'>
  25. instance = <MACDB: 00:22:64:A0:6B:34>
  26. self = <noc.lib.nosql.PlainReferenceField object at 0x80784c950>
  27. value = ObjectId('4eddc783f3b6825b8c002cdc')
  28. v = None
  29. ------------------------------------------------------------------------
  30. File: /opt/noc/inv/models/macdb.py (Line: 67)
  31. Function: submit
  32. 60 timestamp = datetime.datetime.now()
  33. 61 managed_object = interface.managed_object
  34. 62 mac = MAC(mac)
  35. 63 vcd = vc_domain.id if vc_domain else None
  36. 64 m = MACDB.objects.filter(mac=mac, vc_domain=vcd).first()
  37. 65 if m:
  38. 66 if (managed_object != m.managed_object or
  39. 67 ==> interface != m.interface or vlan != m.vlan):
  40. 68 # Database change, write history
  41. 69 MACLog(
  42. 70 timestamp=m.last_changed,
  43. 71 mac=mac,
  44. 72 vc_domain_name=vc_domain.name if vc_domain else None,
  45. 73 vlan=m.vlan,
  46. Variables:
  47. vcd = 16
  48. timestamp = datetime.datetime(2012, 12, 19, 14, 19, 16, 658053)
  49. vlan = 831
  50. m = <MACDB: 00:22:64:A0:6B:34>
  51. managed_object = <ManagedObject: cat->
  52. mac = '00:22:64:A0:6B:34'
  53. vc_domain = <VCDomain: NN>
  54. interface = <Interface: cat-: Gi 0/13>
  55. cls = <class 'noc.inv.models.macdb.MACDB'>
  56. ------------------------------------------------------------------------
  57. File: /opt/noc/inv/discovery/reports/macreport.py (Line: 32)
  58. Function: submit
  59. 25 if not self.enabled:
  60. 26 return
  61. 27 iface = self.get_interface(managed_object, if_name)
  62. 28 if not iface:
  63. 29 return # Not found
  64. 30 if not iface.profile.mac_discovery:
  65. 31 return # Disabled discovery
  66. 32 ==> if MACDB.submit(mac, vc_domain, vlan, iface):
  67. 33 self.info("MAC %s. VC Domain: %s, VLAN %d at %s" % (
  68. 34 mac,
  69. 35 vc_domain.name if vc_domain else None,
  70. 36 vlan, if_name))
  71. 37 self.changed += [(mac, vlan, iface)]
  72. 38
  73. Variables:
  74. iface = <Interface: cat-: Gi 0/13>
  75. vc_domain = <VCDomain: NN>
  76. self = <noc.inv.discovery.reports.macreport.MACReport object at 0x808950810>
  77. vlan = 831
  78. managed_object = <ManagedObject: cat->
  79. if_name = 'Gi 0/13'
  80. mac = '00:22:64:A0:6B:34'
  81. ------------------------------------------------------------------------
  82. File: /opt/noc/inv/discovery/jobs/mac_discovery.py (Line: 57)
  83. Function: handler
  84. 50 if (v["type"] == "D" and v["interfaces"] and
  85. 51 v["mac"] not in dups):
  86. 52 self.report.submit(
  87. 53 mac=v["mac"],
  88. 54 vc_domain=vc_domain,
  89. 55 vlan=v["vlan_id"],
  90. 56 managed_object=object,
  91. 57 ==> if_name=v["interfaces"][0]
  92. 58 )
  93. 59 self.report.send()
  94. 60 return True
  95. 61
  96. 62 @classmethod
  97. 63 def initial_submit_queryset(cls):
  98. Variables:
  99. object = <ManagedObject: cat->
  100. dups = set(['00:11:20:E7:C2:78', '00:11:93:D5:33:C0'])
  101. vc_domain = <VCDomain: NN>
  102. self = <noc.inv.discovery.jobs.mac_discovery.MACDiscoveryJob object at 0x80895b750>
  103. vlan = 4091
  104. mac = '98:4B:E1:6B:36:7C'
  105. result = [{'mac': '00:00:21:00:7B:69', ...
  106. v = {'mac': '00:22:64:A0:6B:34', 'type': 'D', 'interfaces': ['Gi 0/13'], 'vlan_id': 831}
  107. seen = {'2C:27:D7:2E:5C:4F': 46, ...
  108. ------------------------------------------------------------------------
  109. File: /opt/noc/lib/scheduler/scheduler.py (Line: 242)
  110. Function: _job_wrapper
  111. 235 t.start()
  112. 236 else:
  113. 237 return self._job_wrapper(job, **kwargs)
  114. 238
  115. 239 def _job_wrapper(self, job, **kwargs):
  116. 240 tb = None
  117. 241 try:
  118. 242 ==> r = job.handler(**kwargs)
  119. 243 except Exception:
  120. 244 error_report()
  121. 245 job.on_exception()
  122. 246 s = job.S_EXCEPTION
  123. 247 tb = get_traceback()
  124. 248 else:
  125. Variables:
  126. job = <noc.inv.discovery.jobs.mac_discovery.MACDiscoveryJob object at 0x80895b750>
  127. tb = None
  128. self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x804f5fe90>
  129. kwargs = {'object': <ManagedObject: cat->, 'result': [{'mac':...
  130. ------------------------------------------------------------------------
  131. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement