Guest User

Untitled

a guest
Aug 17th, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1. 2015-08-17 14:17:00,028 [noc.lib.scheduler.job] [inv.discovery][interface_discovery][jnr01-yla-laz] UNHANDLED EXCEPTION (2015-08-17 14:16:58.311971)
  2. BRANCH: develop TIP: f7f668308cd7
  3. PROCESS: ./scripts/noc-discovery.py
  4. WORKING DIRECTORY: /opt/noc
  5. EXCEPTION: <class 'mongoengine.errors.ValidationError'> Unable to dereference <class 'noc.inv.models.interface.Interface'>:533219a27e85c95907cb5663
  6. START OF TRACEBACK
  7. ------------------------------------------------------------------------
  8. File: lib/nosql.py (Line: 144)
  9. Function: __get__
  10. 137 v = self.document_type.objects(id=value).first()
  11. 138 if v and self.ttl:
  12. 139 self._DEREF_CACHE[str(value)] = (t + self.ttl, v)
  13. 140 if v is not None:
  14. 141 instance._data[self.name] = v
  15. 142 else:
  16. 143 raise ValidationError("Unable to dereference %s:%s" % (
  17. 144 ==> self.document_type, value))
  18. 145 return super(PlainReferenceField, self).__get__(instance, owner)
  19. 146
  20. 147 def to_mongo(self, document):
  21. 148 if isinstance(document, Document):
  22. 149 # We need the id from the saved object to create the DBRef
  23. 150 id_ = document.id
  24. Variables:
  25. owner = <class 'noc.inv.models.interface.Interface'>
  26. instance = <Interface: jnr01-yla-laz: xe-5/3/0>
  27. self = <noc.lib.nosql.PlainReferenceField object at 0x44dfd10>
  28. value = ObjectId('533219a27e85c95907cb5663')
  29. v = None
  30. ------------------------------------------------------------------------
  31. File: inv/discovery/reports/base.py (Line: 57)
  32. Function: update_if_changed
  33. 50 :param ignore_empty: List of fields which may be ignored if empty
  34. 51 :returns: List of changed (key, value)
  35. 52 :rtype: list
  36. 53 """
  37. 54 changes = []
  38. 55 ignore_empty = ignore_empty or []
  39. 56 for k, v in values.items():
  40. 57 ==> vv = getattr(obj, k)
  41. 58 if v != vv:
  42. 59 if type(v) != int or not hasattr(vv, "id") or v != vv.id:
  43. 60 if k in ignore_empty and (v is None or v == ""):
  44. 61 continue
  45. 62 setattr(obj, k, v)
  46. 63 changes += [(k, v)]
  47. Variables:
  48. obj = <Interface: jnr01-yla-laz: xe-5/3/0>
  49. k = 'aggregated_interface'
  50. ignore_empty = ['ifindex']
  51. values =
  52. {'aggregated_interface': None,
  53. 'description': '*** Centr-AGG-5 ***',
  54. 'enabled_protocols': [],
  55. 'ifindex': 552,
  56. 'mac': '78:19:F7:07:FF:68',
  57. 'type': 'physical'}
  58. vv = u'78:19:F7:07:FF:C1'
  59. v = None
  60. changes = [('description', '*** Centr-AGG-5 ***'), ('mac', '78:19:F7:07:FF:68')]
  61. self =
  62. <noc.inv.discovery.reports.interfacereport.InterfaceReport object at 0x5090ad0>
  63. ------------------------------------------------------------------------
  64. File: inv/discovery/reports/interfacereport.py (Line: 143)
  65. Function: submit_interface
  66. 136 changes = self.update_if_changed(iface, {
  67. 137 "type": type,
  68. 138 "mac": mac,
  69. 139 "description": description,
  70. 140 "aggregated_interface": aggregated_interface,
  71. 141 "enabled_protocols": enabled_protocols,
  72. 142 "ifindex": ifindex
  73. 143 ==> }, ignore_empty=["ifindex"])
  74. 144 self.log_changes("Interface '%s' has been changed" % name,
  75. 145 changes)
  76. 146 else:
  77. 147 # Create interface
  78. 148 self.info("Creating interface '%s'" % name)
  79. 149 iface = Interface(
  80. Variables:
  81. iface = <Interface: jnr01-yla-laz: xe-5/3/0>
  82. description = '*** Centr-AGG-5 ***'
  83. enabled_protocols = []
  84. self =
  85. <noc.inv.discovery.reports.interfacereport.InterfaceReport object at 0x5090ad0>
  86. mac = '78:19:F7:07:FF:68'
  87. aggregated_interface = None
  88. ifindex = 552
  89. type = 'physical'
  90. name = 'xe-5/3/0'
  91. ------------------------------------------------------------------------
  92. File: inv/discovery/jobs/interface_discovery.py (Line: 81)
  93. Function: handler
  94. 74 continue
  95. 75 # Submit discovered interface
  96. 76 iface = self.report.submit_interface(
  97. 77 name=i["name"], type=i["type"], mac=i.get("mac"),
  98. 78 description=i.get("description"),
  99. 79 aggregated_interface=agg,
  100. 80 enabled_protocols=i.get("enabled_protocols", []),
  101. 81 ==> ifindex=i.get("snmp_ifindex")
  102. 82 )
  103. 83 icache[i["name"]] = iface
  104. 84 # Submit subinterfaces
  105. 85 for si in i["subinterfaces"]:
  106. 86 self.report.submit_subinterface(
  107. 87 forwarding_instance=forwarding_instance,
  108. Variables:
  109. iface = <Interface: jnr01-yla-laz: xe-5/2/1>
  110. ifaces =
  111. [{'admin_status': True,
  112. 'description': '*** Centr-AGG6 ***',
  113. 'mac': '78:19:F7:07:FB:DE',
  114. 'name': 'xe-3/0/0',
  115. 'oper_status': True,
  116. 'snmp_ifindex': 807,
  117. 'subinterfaces': [{'admin_status': True,
  118. 'enabled_afi': [],
  119. 'mac': '78:19:F7:07:FB:DE',
  120. 'name': 'xe-3/0/0.1299',
  121. 'oper_status': True,
  122. 'snmp_ifindex': 938},
  123. {'admin_status': True,
  124. 'enabled_afi': [],
  125. 'mac': '78:19:F7:07:FB:DE',
  126. 'name': 'xe-3/0/0.1468',
  127. 'oper_status': True,
  128. 'snmp_ifindex': 950},
  129. {'admin_status': True,
  130. 'enabled_afi': [],
  131. 'mac': '78:19:F7:07:FB:DE',
  132. 'name': 'xe-3/0/0.2004',
  133. 'oper_status': True,
  134. 'snmp_ifindex': 943},
  135. {'admin_status': True,
  136. 'enabled_afi': [],
  137. 'mac': '78:19:F7:07:FB:DE',
  138. 'name': 'xe-3/0/0.2032',
  139. 'oper_status': True,
  140. 'snmp_ifindex': 944},
  141. {'admin_status': True,
  142. 'enabled_afi': [],
  143. 'mac': '78:19:F7:07:FB:DE',
  144. 'name': 'xe-3/0/0.2111',
  145. 'oper_status': True,
  146. 'snmp_ifindex': 945},
  147. {'admin_status': True,
  148. 'enabled_afi': [],
  149. 'mac': '78:19:F7:07:FB:DE',
  150. 'name': 'xe-3/0/0.2112',
  151. 'oper_status': True,
  152. 'snmp_ifindex': 946},
  153. {'admin_status': True,
  154. 'enabled_afi': [],
  155. 'mac': '78:19:F7:07:FB:DE',
  156. 'name': 'xe-3/0/0.3119',
  157. 'oper_status': True,
  158. 'snmp_ifindex': 941},
Advertisement
Add Comment
Please, Sign In to add comment