Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2012-07-31 16:47:12,452 Running interface discovery for V1_KIR_3
- 2012-07-31 16:47:32,725 UNHANDLED EXCEPTION (2012-07-31 16:47:32.708054)
- Working directory: /var/backups/noc
- <class 'django.db.utils.DatabaseError'>
- can't adapt type 'MAC'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /var/backups/noc/contrib/lib/django/db/backends/postgresql_psycopg2/base.py (Line: 44)
- Function: execute
- 37 """
- 38
- 39 def __init__(self, cursor):
- 40 self.cursor = cursor
- 41
- 42 def execute(self, query, args=None):
- 43 try:
- 44 ==> return self.cursor.execute(query, args)
- 45 except Database.IntegrityError, e:
- 46 raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2]
- 47 except Database.DatabaseError, e:
- 48 raise utils.DatabaseError, utils.DatabaseError(*tuple(e)), sys.exc_info()[2]
- 49
- 50 def executemany(self, query, args):
- Variables:
- query = 'UPDATE "ip_address" SET "prefix_id" = %s, "vrf_id" = %s, "afi" = %s, "address" = %s, "fqdn" = %s, "mac" = %s, "auto_update_mac" = %s, "managed_object_id" = %s, "description" = %s, "tags" = %s, "tt" = NULL, "style_id" = NULL, "state_id" = %s, "allocated_till" = NULL, "ipv6_transition_id" = NULL WHERE "ip_address"."id" = %s '
- self = <django.db.backends.postgresql_psycopg2.base.CursorWrapper object at 0x3b67690>
- args = (1522, 1, '4', '10.200.13.2', u'kir3.example.com', '70:72:CF:56:BE:A5', False, 25, 'V1_KIR_3:VLAN 270', u'', 1, 8213)
- e = ProgrammingError("can't adapt type 'MAC'",)
- ------------------------------------------------------------------------
- File: /var/backups/noc/contrib/lib/django/db/backends/util.py (Line: 34)
- Function: execute
- 27
- 28
- 29 class CursorDebugWrapper(CursorWrapper):
- 30
- 31 def execute(self, sql, params=()):
- 32 start = time()
- 33 try:
- 34 ==> return self.cursor.execute(sql, params)
- 35 finally:
- 36 stop = time()
- 37 duration = stop - start
- 38 sql = self.db.ops.last_executed_query(self.cursor, sql, params)
- 39 self.db.queries.append({
- 40 'sql': sql,
- Variables:
- self = <django.db.backends.util.CursorDebugWrapper object at 0x3b673d0>
- stop = 1343742452.708009
- start = 1343742452.7079661
- params = (1522, 1, '4', '10.200.13.2', u'kir3.example.com', '70:72:CF:56:BE:A5', False, 25, 'V1_KIR_3:VLAN 270', u'', 1, 8213)
- sql = None
- duration = 4.291534423828125e-05
- ------------------------------------------------------------------------
- File: /var/backups/noc/contrib/lib/django/db/models/sql/compiler.py (Line: 735)
- Function: execute_sql
- 728 except EmptyResultSet:
- 729 if result_type == MULTI:
- 730 return empty_iter()
- 731 else:
- 732 return
- 733
- 734 cursor = self.connection.cursor()
- 735 ==> cursor.execute(sql, params)
- 736
- 737 if not result_type:
- 738 return cursor
- 739 if result_type == SINGLE:
- 740 if self.query.ordering_aliases:
- 741 return cursor.fetchone()[:-len(self.query.ordering_aliases)]
- Variables:
- cursor = <django.db.backends.util.CursorDebugWrapper object at 0x3b673d0>
- self = <django.db.models.sql.compiler.SQLUpdateCompiler object at 0x3b67250>
- params = (1522, 1, '4', '10.200.13.2', u'kir3.example.com', '70:72:CF:56:BE:A5', False, 25, 'V1_KIR_3:VLAN 270', u'', 1, 8213)
- result_type = None
- sql = 'UPDATE "ip_address" SET "prefix_id" = %s, "vrf_id" = %s, "afi" = %s, "address" = %s, "fqdn" = %s, "mac" = %s, "auto_update_mac" = %s, "managed_object_id" = %s, "description" = %s, "tags" = %s, "tt" = NULL, "style_id" = NULL, "state_id" = %s, "allocated_till" = NULL, "ipv6_transition_id" = NULL WHERE "ip_address"."id" = %s '
- ------------------------------------------------------------------------
- File: /var/backups/noc/contrib/lib/django/db/models/sql/compiler.py (Line: 869)
- Function: execute_sql
- 862 def execute_sql(self, result_type):
- 863 """
- 864 Execute the specified update. Returns the number of rows affected by
- 865 the primary update query. The "primary update query" is the first
- 866 non-empty query that is executed. Row counts for any subsequent,
- 867 related queries are not available.
- 868 """
- 869 ==> cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
- 870 rows = cursor and cursor.rowcount or 0
- 871 is_empty = cursor is None
- 872 del cursor
- 873 for query in self.query.get_related_updates():
- 874 aux_rows = query.get_compiler(self.using).execute_sql(result_type)
- 875 if is_empty:
- Variables:
- self = <django.db.models.sql.compiler.SQLUpdateCompiler object at 0x3b67250>
- result_type = None
- ------------------------------------------------------------------------
- File: /var/backups/noc/contrib/lib/django/db/models/query.py (Line: 491)
- Function: _update
- 484 useful at that level).
- 485 """
- 486 assert self.query.can_filter(), \
- 487 "Cannot update a query once a slice has been taken."
- 488 query = self.query.clone(sql.UpdateQuery)
- 489 query.add_update_fields(values)
- 490 self._result_cache = None
- 491 ==> return query.get_compiler(self.db).execute_sql(None)
- 492 _update.alters_data = True
- 493
- 494 def exists(self):
- 495 if self._result_cache is None:
- 496 return self.query.has_results(using=self.db)
- 497 return bool(self._result_cache)
- Variables:
- query = <django.db.models.sql.subqueries.UpdateQuery object at 0x3b67610>
- self = [<Address: default(4): 10.200.13.2>]
- values = [(<django.db.models.fields.related.ForeignKey object at 0x3646490>, None, 1522), (<django.db.models.fields.related.ForeignKey object at 0x3646610>, None, 1), (<django.db.models.fields.CharField object at 0x3646710>, None, '4'), (<noc.lib.fields.INETField object at 0x3646810>, None, '10.200.13.2'), (<django.db.models.fields.CharField object at 0x36468d0>, None, u'kir3.example.com'), (<noc.lib.fields.MACField object at 0x3646a50>, None, '70:72:CF:56:BE:A5'), (<django.db.models.fields.BooleanField object at 0x3646ad0>, None, False), (<django.db.models.fields.related.ForeignKey object at 0x3646c10>, None, 25), (<django.db.models.fields.TextField object at 0x3646d50>, None, 'V1_KIR_3:VLAN 270'), (<noc.lib.fields.AutoCompleteTagsField object at 0x3646dd0>, None, u''), (<django.db.models.fields.IntegerField object at 0x3646f90>, None, None), (<django.db.models.fields.related.ForeignKey object at 0x3649050>, None, None), (<django.db.models.fields.related.ForeignKey object at 0x3649190>, None, 1), (<django.db.models.fields.DateField object at 0x36492d0>, None, None), (<django.db.models.fields.related.OneToOneField object at 0x3649350>, None, None)]
- ------------------------------------------------------------------------
- File: /var/backups/noc/contrib/lib/django/db/models/base.py (Line: 526)
- Function: save_base
- 519 if pk_set:
- 520 # Determine whether a record with the primary key already exists.
- 521 if (force_update or (not force_insert and
- 522 manager.using(using).filter(pk=pk_val).exists())):
- 523 # It does already exist, so do an UPDATE.
- 524 if force_update or non_pks:
- 525 values = [(f, None, (raw and getattr(self, f.attname) or f.pre_save(self, False))) for f in non_pks]
- 526 ==> rows = manager.using(using).filter(pk=pk_val)._update(values)
- 527 if force_update and not rows:
- 528 raise DatabaseError("Forced update did not affect any rows.")
- 529 else:
- 530 record_exists = False
- 531 if not pk_set or not record_exists:
- 532 if meta.order_with_respect_to:
- Variables:
- origin = <class 'noc.ip.models.Address'>
- non_pks = [<django.db.models.fields.related.ForeignKey object at 0x3646490>, <django.db.models.fields.related.ForeignKey object at 0x3646610>, <django.db.models.fields.CharField object at 0x3646710>, <noc.lib.fields.INETField object at 0x3646810>, <django.db.models.fields.CharField object at 0x36468d0>, <noc.lib.fields.MACField object at 0x3646a50>, <django.db.models.fields.BooleanField object at 0x3646ad0>, <django.db.models.fields.related.ForeignKey object at 0x3646c10>, <django.db.models.fields.TextField object at 0x3646d50>, <noc.lib.fields.AutoCompleteTagsField object at 0x3646dd0>, <django.db.models.fields.IntegerField object at 0x3646f90>, <django.db.models.fields.related.ForeignKey object at 0x3649050>, <django.db.models.fields.related.ForeignKey object at 0x3649190>, <django.db.models.fields.DateField object at 0x36492d0>, <django.db.models.fields.related.OneToOneField object at 0x3649350>]
- f = <django.db.models.fields.related.OneToOneField object at 0x3649350>
- self = <Address: default(4): 10.200.13.2>
- force_update = False
- connection = <django.db.backends.postgresql_psycopg2.base.DatabaseWrapper object at 0x1ca48e8>
- raw = False
- manager = <django.db.models.manager.Manager object at 0x3649a90>
- meta = <Options for Address>
- values = [(<django.db.models.fields.related.ForeignKey object at 0x3646490>, None, 1522), (<django.db.models.fields.related.ForeignKey object at 0x3646610>, None, 1), (<django.db.models.fields.CharField object at 0x3646710>, None, '4'), (<noc.lib.fields.INETField object at 0x3646810>, None, '10.200.13.2'), (<django.db.models.fields.CharField object at 0x36468d0>, None, u'kir3.example.com'), (<noc.lib.fields.MACField object at 0x3646a50>, None, '70:72:CF:56:BE:A5'), (<django.db.models.fields.BooleanField object at 0x3646ad0>, None, False), (<django.db.models.fields.related.ForeignKey object at 0x3646c10>, None, 25), (<django.db.models.fields.TextField object at 0x3646d50>, None, 'V1_KIR_3:VLAN 270'), (<noc.lib.fields.AutoCompleteTagsField object at 0x3646dd0>, None, u''), (<django.db.models.fields.IntegerField object at 0x3646f90>, None, None), (<django.db.models.fields.related.ForeignKey object at 0x3649050>, None, None), (<django.db.models.fields.related.ForeignKey object at 0x3649190>, None, 1), (<django.db.models.fields.DateField object at 0x36492d0>, None, None), (<django.db.models.fields.related.OneToOneField object at 0x3649350>, None, None)]
- pk_val = 8213
- using = 'default'
- pk_set = True
- org = None
- cls = <class 'noc.ip.models.Address'>
- force_insert = False
- record_exists = True
- ------------------------------------------------------------------------
- File: /var/backups/noc/contrib/lib/django/db/models/base.py (Line: 460)
- Function: save
- 453
- 454 The 'force_insert' and 'force_update' parameters can be used to insist
- 455 that the "save" must be an SQL insert or update (or equivalent for
- 456 non-SQL backends), respectively. Normally, they should not be set.
- 457 """
- 458 if force_insert and force_update:
- 459 raise ValueError("Cannot force both insert and updating in model saving.")
- 460 ==> self.save_base(using=using, force_insert=force_insert, force_update=force_update)
- 461
- 462 save.alters_data = True
- 463
- 464 def save_base(self, raw=False, cls=None, origin=None, force_insert=False,
- 465 force_update=False, using=None):
- 466 """
- Variables:
- using = None
- self = <Address: default(4): 10.200.13.2>
- force_update = False
- force_insert = False
- ------------------------------------------------------------------------
- File: /var/backups/noc/ip/models/__init__.py (Line: 672)
- Function: save
- 665 if cv:
- 666 # Collision detected
- 667 raise ValidationError("Address already exists in VRF %s" % cv)
- 668 # Detect AFI
- 669 self.afi = self.get_afi(self.address)
- 670 # Set proper prefix
- 671 self.prefix = Prefix.get_parent(self.vrf, self.afi, self.address)
- 672 ==> super(Address, self).save(**kwargs)
- 673
- 674 ##
- 675 ## Field validation
- 676 ##
- 677 def clean(self):
- 678 self.prefix = Prefix.get_parent(self.vrf, self.afi, self.address)
- Variables:
- self = <Address: default(4): 10.200.13.2>
- cv = None
- kwargs = {}
- ------------------------------------------------------------------------
- File: /var/backups/noc/inv/discovery/daemon.py (Line: 235)
- Function: update_if_changed
- 228 for k, v in values.items():
- 229 vv = getattr(obj, k)
- 230 if v != vv:
- 231 if type(v) != int or not hasattr(vv, "id") or v != vv.id:
- 232 setattr(obj, k, v)
- 233 changes += [(k, v)]
- 234 if changes:
- 235 ==> obj.save()
- 236 return changes
- 237
- 238 def log_changes(self, o, msg, changes):
- 239 """
- 240 Log changes
- 241 :param o: managed object
- Variables:
- obj = <Address: default(4): 10.200.13.2>
- k = 'description'
- values = {'mac': '70:72:CF:56:BE:A5', 'managed_object': <ManagedObject: V1_KIR_3>, 'description': 'V1_KIR_3:VLAN 270'}
- vv = u''
- v = 'V1_KIR_3:VLAN 270'
- changes = [('mac', '70:72:CF:56:BE:A5'), ('description', 'V1_KIR_3:VLAN 270')]
- self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x376a590>
- ------------------------------------------------------------------------
- File: /var/backups/noc/inv/discovery/daemon.py (Line: 736)
- Function: refresh_prefix
- 729 ).save()
- 730 else:
- 731 changes = {"managed_object": o}
- 732 if si.get("mac"):
- 733 changes["mac"] = si.get("mac")
- 734 if not a.description:
- 735 changes["description"] = "%s:%s" % (o, si["name"])
- 736 ==> self.update_if_changed(a, changes)
- 737 # Dual-stacking detection
- 738 if addresses and len(ipv4_addresses) == len(ipv6_addresses):
- 739 for ipv4, ipv6 in zip(ipv4_addresses, ipv6_addresses):
- 740 try:
- 741 p4 = Prefix.objects.get(vrf=vrf, afi="4",
- 742 prefix=str(IP.prefix(ipv4).normalized))
- Variables:
- a = <Address: default(4): 10.200.13.2>
- rd = '0:0'
- addresses = ['10.200.13.2/26']
- octx = {'host': u'V1_KIR_3', 'object': <ManagedObject: V1_KIR_3>, 'name': u'V1_KIR_3', 'domain': None, 'vrf': <VRF: global>}
- o = <ManagedObject: V1_KIR_3>
- self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x376a590>
- si = {'name': 'VLAN 270', 'mac': '70:72:CF:56:BE:A5', 'ipv4_addresses': ['10.200.13.2/26'], 'vlan_ids': [270], 'oper_status': True, 'admin_status': True, 'is_ipv4': True}
- ipv4_addresses = ['10.200.13.2/26']
- ipv6_addresses = []
- p = <IPv4 10.200.13.2/26>
- prefix = '10.200.13.0/26'
- vrf_name = 'default'
- vrf = <VRF: global>
- seen = set(['10.200.13.0/26'])
- pfx = <Prefix: default(4): 10.200.13.0/26>
- changes = {'mac': '70:72:CF:56:BE:A5', 'managed_object': <ManagedObject: V1_KIR_3>, 'description': 'V1_KIR_3:VLAN 270'}
- ------------------------------------------------------------------------
- File: /var/backups/noc/inv/discovery/daemon.py (Line: 539)
- Function: import_interfaces
- 532 s_iface.save()
- 533 # refreshed = True
- 534 si_count += 1
- 535 # Run prefix discovery when necessary
- 536 if (self.p_save and # refreshed and
- 537 (si.get("is_ipv4") or si.get("is_ipv6"))):
- 538 self.refresh_prefix(o, fi["forwarding_instance"],
- 539 ==> fi.get("rd", "0:0"), si)
- 540 # Perform interface classification
- 541 self.interface_classification(iface)
- 542 # Remove hanging interfaces
- 543 db_interfaces = set(x.name for x in
- 544 Interface.objects.filter(managed_object=o.id).only("name"))
- 545 for i in db_interfaces - found_interfaces:
- Variables:
- iface = <Interface: V1_KIR_3: VLAN 270>
- ifaces = [{'name': 'VLAN 270', 'subinterfaces': [{'name': 'VLAN 270', 'mac': '70:72:CF:56:BE:A5', 'ipv4_addresses': ['10.200.13.2/26'], 'vlan_ids': [270], 'oper_status': True, 'admin_status': True, 'is_ipv4': True}], 'mac': '70:72:CF:56:BE:A5', 'oper_status': True, 'admin_status': True, 'type': 'SVI'}, {'name': 'Eth 1/8', 'subinterfaces': [{'name': 'Eth 1/8', 'tagged_vlans': [], 'oper_status': False, 'untagged_vlan': 278, 'mac': '70:72:CF:56:BE:AD', 'admin_status': False, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AD', 'oper_status': False, 'admin_status': False, 'type': 'physical'}, {'name': 'Eth 1/9', 'subinterfaces': [{'name': 'Eth 1/9', 'tagged_vlans': [270, 271, 272, 273, 274, 275, 276, 277, 278, 1000], 'oper_status': True, 'mac': '70:72:CF:56:BE:AE', 'admin_status': True, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AE', 'oper_status': True, 'admin_status': True, 'type': 'physical'}, {'name': 'Eth 1/2', 'subinterfaces': [{'description': 'Kirova_1', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 272, 'mac': '70:72:CF:56:BE:A7', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/2'}], 'mac': '70:72:CF:56:BE:A7', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_1'}, {'name': 'Eth 1/3', 'subinterfaces': [{'description': 'Simonova_1A', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 273, 'mac': '70:72:CF:56:BE:A8', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/3'}], 'mac': '70:72:CF:56:BE:A8', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_1A'}, {'name': 'Eth 1/1', 'subinterfaces': [{'description': 'Kirova_5', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 271, 'mac': '70:72:CF:56:BE:A6', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/1'}], 'mac': '70:72:CF:56:BE:A6', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_5'}, {'name': 'Eth 1/6', 'subinterfaces': [{'description': 'Simonova_2', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 276, 'mac': '70:72:CF:56:BE:AB', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/6'}], 'mac': '70:72:CF:56:BE:AB', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_2'}, {'name': 'Eth 1/7', 'subinterfaces': [{'description': 'Kirova_03', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 277, 'mac': '70:72:CF:56:BE:AC', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/7'}], 'mac': '70:72:CF:56:BE:AC', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_03'}, {'name': 'Eth 1/4', 'subinterfaces': [{'description': 'Kirova_5A', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 274, 'mac': '70:72:CF:56:BE:A9', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/4'}], 'mac': '70:72:CF:56:BE:A9', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_5A'}, {'name': 'Eth 1/5', 'subinterfaces': [{'description': 'Simonova_1', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 275, 'mac': '70:72:CF:56:BE:AA', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/5'}], 'mac': '70:72:CF:56:BE:AA', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_1'}, {'name': 'Eth 1/10', 'subinterfaces': [{'name': 'Eth 1/10', 'tagged_vlans': [270, 271, 272, 273, 274, 275, 276, 277, 278, 1000], 'oper_status': False, 'mac': '70:72:CF:56:BE:AF', 'admin_status': False, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AF', 'oper_status': False, 'admin_status': False, 'type': 'physical'}]
- agg = None
- si_count = 1
- interfaces = [{'interfaces': [{'name': 'VLAN 270', 'subinterfaces': [{'name': 'VLAN 270', 'mac': '70:72:CF:56:BE:A5', 'ipv4_addresses': ['10.200.13.2/26'], 'vlan_ids': [270], 'oper_status': True, 'admin_status': True, 'is_ipv4': True}], 'mac': '70:72:CF:56:BE:A5', 'oper_status': True, 'admin_status': True, 'type': 'SVI'}, {'name': 'Eth 1/8', 'subinterfaces': [{'name': 'Eth 1/8', 'tagged_vlans': [], 'oper_status': False, 'untagged_vlan': 278, 'mac': '70:72:CF:56:BE:AD', 'admin_status': False, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AD', 'oper_status': False, 'admin_status': False, 'type': 'physical'}, {'name': 'Eth 1/9', 'subinterfaces': [{'name': 'Eth 1/9', 'tagged_vlans': [270, 271, 272, 273, 274, 275, 276, 277, 278, 1000], 'oper_status': True, 'mac': '70:72:CF:56:BE:AE', 'admin_status': True, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AE', 'oper_status': True, 'admin_status': True, 'type': 'physical'}, {'name': 'Eth 1/2', 'subinterfaces': [{'description': 'Kirova_1', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 272, 'mac': '70:72:CF:56:BE:A7', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/2'}], 'mac': '70:72:CF:56:BE:A7', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_1'}, {'name': 'Eth 1/3', 'subinterfaces': [{'description': 'Simonova_1A', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 273, 'mac': '70:72:CF:56:BE:A8', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/3'}], 'mac': '70:72:CF:56:BE:A8', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_1A'}, {'name': 'Eth 1/1', 'subinterfaces': [{'description': 'Kirova_5', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 271, 'mac': '70:72:CF:56:BE:A6', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/1'}], 'mac': '70:72:CF:56:BE:A6', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_5'}, {'name': 'Eth 1/6', 'subinterfaces': [{'description': 'Simonova_2', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 276, 'mac': '70:72:CF:56:BE:AB', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/6'}], 'mac': '70:72:CF:56:BE:AB', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_2'}, {'name': 'Eth 1/7', 'subinterfaces': [{'description': 'Kirova_03', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 277, 'mac': '70:72:CF:56:BE:AC', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/7'}], 'mac': '70:72:CF:56:BE:AC', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_03'}, {'name': 'Eth 1/4', 'subinterfaces': [{'description': 'Kirova_5A', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 274, 'mac': '70:72:CF:56:BE:A9', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/4'}], 'mac': '70:72:CF:56:BE:A9', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_5A'}, {'name': 'Eth 1/5', 'subinterfaces': [{'description': 'Simonova_1', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 275, 'mac': '70:72:CF:56:BE:AA', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/5'}], 'mac': '70:72:CF:56:BE:AA', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_1'}, {'name': 'Eth 1/10', 'subinterfaces': [{'name': 'Eth 1/10', 'tagged_vlans': [270, 271, 272, 273, 274, 275, 276, 277, 278, 1000], 'oper_status': False, 'mac': '70:72:CF:56:BE:AF', 'admin_status': False, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AF', 'oper_status': False, 'admin_status': False, 'type': 'physical'}], 'type': 'ip', 'forwarding_instance': 'default'}]
- o = <ManagedObject: V1_KIR_3>
- s_iface = <SubInterface: V1_KIR_3 VLAN 270>
- q = <mongoengine.queryset.QCombination object at 0x3df0610>
- i = {'name': 'VLAN 270', 'subinterfaces': [{'name': 'VLAN 270', 'mac': '70:72:CF:56:BE:A5', 'ipv4_addresses': ['10.200.13.2/26'], 'vlan_ids': [270], 'oper_status': True, 'admin_status': True, 'is_ipv4': True}], 'mac': '70:72:CF:56:BE:A5', 'oper_status': True, 'admin_status': True, 'type': 'SVI'}
- si = {'name': 'VLAN 270', 'mac': '70:72:CF:56:BE:A5', 'ipv4_addresses': ['10.200.13.2/26'], 'vlan_ids': [270], 'oper_status': True, 'admin_status': True, 'is_ipv4': True}
- icache = {'VLAN 270': <Interface: V1_KIR_3: VLAN 270>}
- forwarding_instance = None
- e_subs = set([])
- fi = {'interfaces': [{'name': 'VLAN 270', 'subinterfaces': [{'name': 'VLAN 270', 'mac': '70:72:CF:56:BE:A5', 'ipv4_addresses': ['10.200.13.2/26'], 'vlan_ids': [270], 'oper_status': True, 'admin_status': True, 'is_ipv4': True}], 'mac': '70:72:CF:56:BE:A5', 'oper_status': True, 'admin_status': True, 'type': 'SVI'}, {'name': 'Eth 1/8', 'subinterfaces': [{'name': 'Eth 1/8', 'tagged_vlans': [], 'oper_status': False, 'untagged_vlan': 278, 'mac': '70:72:CF:56:BE:AD', 'admin_status': False, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AD', 'oper_status': False, 'admin_status': False, 'type': 'physical'}, {'name': 'Eth 1/9', 'subinterfaces': [{'name': 'Eth 1/9', 'tagged_vlans': [270, 271, 272, 273, 274, 275, 276, 277, 278, 1000], 'oper_status': True, 'mac': '70:72:CF:56:BE:AE', 'admin_status': True, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AE', 'oper_status': True, 'admin_status': True, 'type': 'physical'}, {'name': 'Eth 1/2', 'subinterfaces': [{'description': 'Kirova_1', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 272, 'mac': '70:72:CF:56:BE:A7', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/2'}], 'mac': '70:72:CF:56:BE:A7', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_1'}, {'name': 'Eth 1/3', 'subinterfaces': [{'description': 'Simonova_1A', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 273, 'mac': '70:72:CF:56:BE:A8', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/3'}], 'mac': '70:72:CF:56:BE:A8', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_1A'}, {'name': 'Eth 1/1', 'subinterfaces': [{'description': 'Kirova_5', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 271, 'mac': '70:72:CF:56:BE:A6', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/1'}], 'mac': '70:72:CF:56:BE:A6', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_5'}, {'name': 'Eth 1/6', 'subinterfaces': [{'description': 'Simonova_2', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 276, 'mac': '70:72:CF:56:BE:AB', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/6'}], 'mac': '70:72:CF:56:BE:AB', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_2'}, {'name': 'Eth 1/7', 'subinterfaces': [{'description': 'Kirova_03', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 277, 'mac': '70:72:CF:56:BE:AC', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/7'}], 'mac': '70:72:CF:56:BE:AC', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_03'}, {'name': 'Eth 1/4', 'subinterfaces': [{'description': 'Kirova_5A', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 274, 'mac': '70:72:CF:56:BE:A9', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/4'}], 'mac': '70:72:CF:56:BE:A9', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_5A'}, {'name': 'Eth 1/5', 'subinterfaces': [{'description': 'Simonova_1', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 275, 'mac': '70:72:CF:56:BE:AA', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/5'}], 'mac': '70:72:CF:56:BE:AA', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_1'}, {'name': 'Eth 1/10', 'subinterfaces': [{'name': 'Eth 1/10', 'tagged_vlans': [270, 271, 272, 273, 274, 275, 276, 277, 278, 1000], 'oper_status': False, 'mac': '70:72:CF:56:BE:AF', 'admin_status': False, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AF', 'oper_status': False, 'admin_status': False, 'type': 'physical'}], 'type': 'ip', 'forwarding_instance': 'default'}
- found_interfaces = set(['VLAN 270'])
- changes = []
- self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x376a590>
- f_subs = set(['VLAN 270'])
- ------------------------------------------------------------------------
- File: /var/backups/noc/inv/discovery/daemon.py (Line: 296)
- Function: process_interface_discovery
- 289 def process_interface_discovery(self, r):
- 290 """
- 291 Process interface discovery results
- 292 """
- 293 for o, status, result in r:
- 294 if status == "C":
- 295 try:
- 296 ==> self.import_interfaces(o, result)
- 297 except:
- 298 error_report()
- 299 DiscoveryStatusInterface.reschedule(o,
- 300 random.randint(*self.i_success_retry_range), True)
- 301 else:
- 302 self.o_info(o, "get_interfaces failed: %s" % result)
- Variables:
- status = u'C'
- self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x376a590>
- r = [(<ManagedObject: V1_KIR_3>, u'C', [{'interfaces': [{'name': 'VLAN 270', 'subinterfaces': [{'name': 'VLAN 270', 'mac': '70:72:CF:56:BE:A5', 'ipv4_addresses': ['10.200.13.2/26'], 'vlan_ids': [270], 'oper_status': True, 'admin_status': True, 'is_ipv4': True}], 'mac': '70:72:CF:56:BE:A5', 'oper_status': True, 'admin_status': True, 'type': 'SVI'}, {'name': 'Eth 1/8', 'subinterfaces': [{'name': 'Eth 1/8', 'tagged_vlans': [], 'oper_status': False, 'untagged_vlan': 278, 'mac': '70:72:CF:56:BE:AD', 'admin_status': False, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AD', 'oper_status': False, 'admin_status': False, 'type': 'physical'}, {'name': 'Eth 1/9', 'subinterfaces': [{'name': 'Eth 1/9', 'tagged_vlans': [270, 271, 272, 273, 274, 275, 276, 277, 278, 1000], 'oper_status': True, 'mac': '70:72:CF:56:BE:AE', 'admin_status': True, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AE', 'oper_status': True, 'admin_status': True, 'type': 'physical'}, {'name': 'Eth 1/2', 'subinterfaces': [{'description': 'Kirova_1', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 272, 'mac': '70:72:CF:56:BE:A7', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/2'}], 'mac': '70:72:CF:56:BE:A7', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_1'}, {'name': 'Eth 1/3', 'subinterfaces': [{'description': 'Simonova_1A', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 273, 'mac': '70:72:CF:56:BE:A8', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/3'}], 'mac': '70:72:CF:56:BE:A8', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_1A'}, {'name': 'Eth 1/1', 'subinterfaces': [{'description': 'Kirova_5', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 271, 'mac': '70:72:CF:56:BE:A6', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/1'}], 'mac': '70:72:CF:56:BE:A6', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_5'}, {'name': 'Eth 1/6', 'subinterfaces': [{'description': 'Simonova_2', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 276, 'mac': '70:72:CF:56:BE:AB', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/6'}], 'mac': '70:72:CF:56:BE:AB', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_2'}, {'name': 'Eth 1/7', 'subinterfaces': [{'description': 'Kirova_03', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 277, 'mac': '70:72:CF:56:BE:AC', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/7'}], 'mac': '70:72:CF:56:BE:AC', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_03'}, {'name': 'Eth 1/4', 'subinterfaces': [{'description': 'Kirova_5A', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 274, 'mac': '70:72:CF:56:BE:A9', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/4'}], 'mac': '70:72:CF:56:BE:A9', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_5A'}, {'name': 'Eth 1/5', 'subinterfaces': [{'description': 'Simonova_1', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 275, 'mac': '70:72:CF:56:BE:AA', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/5'}], 'mac': '70:72:CF:56:BE:AA', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_1'}, {'name': 'Eth 1/10', 'subinterfaces': [{'name': 'Eth 1/10', 'tagged_vlans': [270, 271, 272, 273, 274, 275, 276, 277, 278, 1000], 'oper_status': False, 'mac': '70:72:CF:56:BE:AF', 'admin_status': False, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AF', 'oper_status': False, 'admin_status': False, 'type': 'physical'}], 'type': 'ip', 'forwarding_instance': 'default'}])]
- result = [{'interfaces': [{'name': 'VLAN 270', 'subinterfaces': [{'name': 'VLAN 270', 'mac': '70:72:CF:56:BE:A5', 'ipv4_addresses': ['10.200.13.2/26'], 'vlan_ids': [270], 'oper_status': True, 'admin_status': True, 'is_ipv4': True}], 'mac': '70:72:CF:56:BE:A5', 'oper_status': True, 'admin_status': True, 'type': 'SVI'}, {'name': 'Eth 1/8', 'subinterfaces': [{'name': 'Eth 1/8', 'tagged_vlans': [], 'oper_status': False, 'untagged_vlan': 278, 'mac': '70:72:CF:56:BE:AD', 'admin_status': False, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AD', 'oper_status': False, 'admin_status': False, 'type': 'physical'}, {'name': 'Eth 1/9', 'subinterfaces': [{'name': 'Eth 1/9', 'tagged_vlans': [270, 271, 272, 273, 274, 275, 276, 277, 278, 1000], 'oper_status': True, 'mac': '70:72:CF:56:BE:AE', 'admin_status': True, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AE', 'oper_status': True, 'admin_status': True, 'type': 'physical'}, {'name': 'Eth 1/2', 'subinterfaces': [{'description': 'Kirova_1', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 272, 'mac': '70:72:CF:56:BE:A7', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/2'}], 'mac': '70:72:CF:56:BE:A7', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_1'}, {'name': 'Eth 1/3', 'subinterfaces': [{'description': 'Simonova_1A', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 273, 'mac': '70:72:CF:56:BE:A8', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/3'}], 'mac': '70:72:CF:56:BE:A8', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_1A'}, {'name': 'Eth 1/1', 'subinterfaces': [{'description': 'Kirova_5', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 271, 'mac': '70:72:CF:56:BE:A6', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/1'}], 'mac': '70:72:CF:56:BE:A6', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_5'}, {'name': 'Eth 1/6', 'subinterfaces': [{'description': 'Simonova_2', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 276, 'mac': '70:72:CF:56:BE:AB', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/6'}], 'mac': '70:72:CF:56:BE:AB', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_2'}, {'name': 'Eth 1/7', 'subinterfaces': [{'description': 'Kirova_03', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 277, 'mac': '70:72:CF:56:BE:AC', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/7'}], 'mac': '70:72:CF:56:BE:AC', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_03'}, {'name': 'Eth 1/4', 'subinterfaces': [{'description': 'Kirova_5A', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 274, 'mac': '70:72:CF:56:BE:A9', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/4'}], 'mac': '70:72:CF:56:BE:A9', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Kirova_5A'}, {'name': 'Eth 1/5', 'subinterfaces': [{'description': 'Simonova_1', 'tagged_vlans': [], 'oper_status': True, 'untagged_vlan': 275, 'mac': '70:72:CF:56:BE:AA', 'admin_status': True, 'is_bridge': True, 'name': 'Eth 1/5'}], 'mac': '70:72:CF:56:BE:AA', 'oper_status': True, 'admin_status': True, 'type': 'physical', 'description': 'Simonova_1'}, {'name': 'Eth 1/10', 'subinterfaces': [{'name': 'Eth 1/10', 'tagged_vlans': [270, 271, 272, 273, 274, 275, 276, 277, 278, 1000], 'oper_status': False, 'mac': '70:72:CF:56:BE:AF', 'admin_status': False, 'is_bridge': True}], 'mac': '70:72:CF:56:BE:AF', 'oper_status': False, 'admin_status': False, 'type': 'physical'}], 'type': 'ip', 'forwarding_instance': 'default'}]
- o = <ManagedObject: V1_KIR_3>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement