Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- BRANCH: develop TIP: f7f668308cd7
- PROCESS: ./scripts/noc-discovery.py
- WORKING DIRECTORY: /opt/noc
- EXCEPTION: <class 'mongoengine.errors.ValidationError'> Unable to dereference <class 'noc.inv.models.interface.Interface'>:533219a27e85c95907cb5663
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: lib/nosql.py (Line: 144)
- Function: __get__
- 137 v = self.document_type.objects(id=value).first()
- 138 if v and self.ttl:
- 139 self._DEREF_CACHE[str(value)] = (t + self.ttl, v)
- 140 if v is not None:
- 141 instance._data[self.name] = v
- 142 else:
- 143 raise ValidationError("Unable to dereference %s:%s" % (
- 144 ==> self.document_type, value))
- 145 return super(PlainReferenceField, self).__get__(instance, owner)
- 146
- 147 def to_mongo(self, document):
- 148 if isinstance(document, Document):
- 149 # We need the id from the saved object to create the DBRef
- 150 id_ = document.id
- Variables:
- owner = <class 'noc.inv.models.interface.Interface'>
- instance = <Interface: jnr01-yla-laz: xe-5/3/0>
- self = <noc.lib.nosql.PlainReferenceField object at 0x44dfd10>
- value = ObjectId('533219a27e85c95907cb5663')
- v = None
- ------------------------------------------------------------------------
- File: inv/discovery/reports/base.py (Line: 57)
- Function: update_if_changed
- 50 :param ignore_empty: List of fields which may be ignored if empty
- 51 :returns: List of changed (key, value)
- 52 :rtype: list
- 53 """
- 54 changes = []
- 55 ignore_empty = ignore_empty or []
- 56 for k, v in values.items():
- 57 ==> vv = getattr(obj, k)
- 58 if v != vv:
- 59 if type(v) != int or not hasattr(vv, "id") or v != vv.id:
- 60 if k in ignore_empty and (v is None or v == ""):
- 61 continue
- 62 setattr(obj, k, v)
- 63 changes += [(k, v)]
- Variables:
- obj = <Interface: jnr01-yla-laz: xe-5/3/0>
- k = 'aggregated_interface'
- ignore_empty = ['ifindex']
- values =
- {'aggregated_interface': None,
- 'description': '*** Centr-AGG-5 ***',
- 'enabled_protocols': [],
- 'ifindex': 552,
- 'mac': '78:19:F7:07:FF:68',
- 'type': 'physical'}
- vv = u'78:19:F7:07:FF:C1'
- v = None
- changes = [('description', '*** Centr-AGG-5 ***'), ('mac', '78:19:F7:07:FF:68')]
- self =
- <noc.inv.discovery.reports.interfacereport.InterfaceReport object at 0x5090ad0>
- ------------------------------------------------------------------------
- File: inv/discovery/reports/interfacereport.py (Line: 143)
- Function: submit_interface
- 136 changes = self.update_if_changed(iface, {
- 137 "type": type,
- 138 "mac": mac,
- 139 "description": description,
- 140 "aggregated_interface": aggregated_interface,
- 141 "enabled_protocols": enabled_protocols,
- 142 "ifindex": ifindex
- 143 ==> }, ignore_empty=["ifindex"])
- 144 self.log_changes("Interface '%s' has been changed" % name,
- 145 changes)
- 146 else:
- 147 # Create interface
- 148 self.info("Creating interface '%s'" % name)
- 149 iface = Interface(
- Variables:
- iface = <Interface: jnr01-yla-laz: xe-5/3/0>
- description = '*** Centr-AGG-5 ***'
- enabled_protocols = []
- self =
- <noc.inv.discovery.reports.interfacereport.InterfaceReport object at 0x5090ad0>
- mac = '78:19:F7:07:FF:68'
- aggregated_interface = None
- ifindex = 552
- type = 'physical'
- name = 'xe-5/3/0'
- ------------------------------------------------------------------------
- File: inv/discovery/jobs/interface_discovery.py (Line: 81)
- Function: handler
- 74 continue
- 75 # Submit discovered interface
- 76 iface = self.report.submit_interface(
- 77 name=i["name"], type=i["type"], mac=i.get("mac"),
- 78 description=i.get("description"),
- 79 aggregated_interface=agg,
- 80 enabled_protocols=i.get("enabled_protocols", []),
- 81 ==> ifindex=i.get("snmp_ifindex")
- 82 )
- 83 icache[i["name"]] = iface
- 84 # Submit subinterfaces
- 85 for si in i["subinterfaces"]:
- 86 self.report.submit_subinterface(
- 87 forwarding_instance=forwarding_instance,
- Variables:
- iface = <Interface: jnr01-yla-laz: xe-5/2/1>
- ifaces =
- [{'admin_status': True,
- 'description': '*** Centr-AGG6 ***',
- 'mac': '78:19:F7:07:FB:DE',
- 'name': 'xe-3/0/0',
- 'oper_status': True,
- 'snmp_ifindex': 807,
- 'subinterfaces': [{'admin_status': True,
- 'enabled_afi': [],
- 'mac': '78:19:F7:07:FB:DE',
- 'name': 'xe-3/0/0.1299',
- 'oper_status': True,
- 'snmp_ifindex': 938},
- {'admin_status': True,
- 'enabled_afi': [],
- 'mac': '78:19:F7:07:FB:DE',
- 'name': 'xe-3/0/0.1468',
- 'oper_status': True,
- 'snmp_ifindex': 950},
- {'admin_status': True,
- 'enabled_afi': [],
- 'mac': '78:19:F7:07:FB:DE',
- 'name': 'xe-3/0/0.2004',
- 'oper_status': True,
- 'snmp_ifindex': 943},
- {'admin_status': True,
- 'enabled_afi': [],
- 'mac': '78:19:F7:07:FB:DE',
- 'name': 'xe-3/0/0.2032',
- 'oper_status': True,
- 'snmp_ifindex': 944},
- {'admin_status': True,
- 'enabled_afi': [],
- 'mac': '78:19:F7:07:FB:DE',
- 'name': 'xe-3/0/0.2111',
- 'oper_status': True,
- 'snmp_ifindex': 945},
- {'admin_status': True,
- 'enabled_afi': [],
- 'mac': '78:19:F7:07:FB:DE',
- 'name': 'xe-3/0/0.2112',
- 'oper_status': True,
- 'snmp_ifindex': 946},
- {'admin_status': True,
- 'enabled_afi': [],
- 'mac': '78:19:F7:07:FB:DE',
- 'name': 'xe-3/0/0.3119',
- 'oper_status': True,
- 'snmp_ifindex': 941},
Advertisement
Add Comment
Please, Sign In to add comment