Guest User

Untitled

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