Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Working directory: /opt/noc
- <class 'django.db.utils.IntegrityError'>
- <ManagedObject: cat-> object is referenced from <class 'noc.fm.models.ActiveEvent'>
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nosql.py (Line: 194)
- Function: on_ref_delete
- 187 :return:
- 188 """
- 189 if not self.name:
- 190 return
- 191 doc = self.owner_document
- 192 if doc.objects.filter(**{self.name: instance.id}).first() is not None:
- 193 raise IntegrityError("%r object is referenced from %r" % (instance,
- 194 ==> doc))
- 195
- 196 def __get__(self, instance, owner):
- 197 """Descriptor to allow lazy dereferencing."""
- 198 if instance is None:
- 199 # Document class being used rather than a document object
- 200 return self
- Variables:
- doc = <class 'noc.fm.models.ActiveEvent'>
- self = <noc.lib.nosql.ForeignKeyField object at 0x80703ff90>
- instance = <ManagedObject: cat->
- sender = <class 'noc.sa.models.managedobject.ManagedObject'>
- kwargs = {'using': 'default', 'signal': <django.dispatch.dispatcher.Signal object at 0x803db2c90>}
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/django/dispatch/dispatcher.py (Line: 172)
- Function: send
- 165 Returns a list of tuple pairs [(receiver, response), ... ].
- 166 """
- 167 responses = []
- 168 if not self.receivers:
- 169 return responses
- 170
- 171 for receiver in self._live_receivers(_make_id(sender)):
- 172 ==> response = receiver(signal=self, sender=sender, **named)
- 173 responses.append((receiver, response))
- 174 return responses
- 175
- 176 def send_robust(self, sender, **named):
- 177 """
- 178 Send signal from sender to all connected receivers catching errors.
- Variables:
- named = {'instance': <ManagedObject: cat->, 'using': 'default'}
- responses = [(<function mo_delete_update_selector_cache at 0x806c476e0>, None), (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x806c54290>>, None), (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x806c54a50>>, None), (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x806c582d0>>, None), (<function mo_delete_update_selector_cache at 0x8070195f0>, None), (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80701a050>>, None), (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80703fb10>>, None), (<bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80703fd10>>, None)]
- self = <django.dispatch.dispatcher.Signal object at 0x803db2c90>
- receiver = <bound method ?.on_ref_delete of <noc.lib.nosql.ForeignKeyField object at 0x80703ff90>>
- response = None
- sender = <class 'noc.sa.models.managedobject.ManagedObject'>
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/django/db/models/deletion.py (Line: 239)
- Function: delete
- 232 # end of a transaction.
- 233 self.sort()
- 234
- 235 # send pre_delete signals
- 236 for model, obj in self.instances_with_model():
- 237 if not model._meta.auto_created:
- 238 signals.pre_delete.send(
- 239 ==> sender=model, instance=obj, using=self.using
- 240 )
- 241
- 242 # update fields
- 243 for model, instances_for_fieldvalues in self.field_updates.iteritems():
- 244 query = sql.UpdateQuery(model)
- 245 for (field, value), instances in instances_for_fieldvalues.iteritems():
- Variables:
- instances = set([<ManagedObject: cat->])
- model = <class 'noc.sa.models.managedobject.ManagedObject'>
- obj = <ManagedObject: cat->
- self = <django.db.models.deletion.Collector object at 0x8080a6e90>
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/django/db/models/deletion.py (Line: 61)
- Function: decorated
- 54 def decorated(self, *args, **kwargs):
- 55 if not transaction.is_managed(using=self.using):
- 56 transaction.enter_transaction_management(using=self.using)
- 57 forced_managed = True
- 58 else:
- 59 forced_managed = False
- 60 try:
- 61 ==> func(self, *args, **kwargs)
- 62 if forced_managed:
- 63 transaction.commit(using=self.using)
- 64 else:
- 65 transaction.commit_unless_managed(using=self.using)
- 66 finally:
- 67 if forced_managed:
- Variables:
- self = <django.db.models.deletion.Collector object at 0x8080a6e90>
- kwargs = {}
- func = <function delete at 0x80443eaa0>
- args = ()
- forced_managed = True
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/django/db/models/base.py (Line: 576)
- Function: delete
- 569
- 570 def delete(self, using=None):
- 571 using = using or router.db_for_write(self.__class__, instance=self)
- 572 assert self._get_pk_val() is not None, "%s object can't be deleted because its %s attribute is set to None." % (self._meta.object_name, self._meta.pk.attname)
- 573
- 574 collector = Collector(using=using)
- 575 collector.collect([self])
- 576 ==> collector.delete()
- 577
- 578 delete.alters_data = True
- 579
- 580 def _get_FIELD_display(self, field):
- 581 value = getattr(self, field.attname)
- 582 return force_unicode(dict(field.flatchoices).get(value, value), strings_only=True)
- Variables:
- using = 'default'
- self = <ManagedObject: cat->
- collector = <django.db.models.deletion.Collector object at 0x8080a6e90>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/models/managedobject.py (Line: 262)
- Function: delete
- 255 if self.name == "SAE":
- 256 raise IntegrityError("Cannot delete SAE object")
- 257 try:
- 258 if self.config.id:
- 259 self.config.delete()
- 260 except Config.DoesNotExist:
- 261 pass
- 262 ==> super(ManagedObject, self).delete()
- 263
- 264 @classmethod
- 265 def search(cls, user, query, limit):
- 266 """
- 267 Search engine plugin
- 268 """
- Variables:
- self = <ManagedObject: cat->
- Config = <class 'noc.cm.models.Config'>
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/wipe.py (Line: 156)
- Function: wipe_managed_object
- 149 a.managed_object = None
- 150 a.save()
- 151 # Delete Managed Object's attributes
- 152 with self.log("Deleting object's attributes"):
- 153 ManagedObjectAttribute.objects.filter(managed_object=o).delete()
- 154 # Finally delete object and config
- 155 with self.log("Deleting managed object and config"):
- 156 ==> o.delete()
- 157
- 158 def get_user(self, u_id):
- 159 """
- 160 Get User by id or name
- 161 :param o_id: Object's id or name
- 162 :return: ManagedObject
- Variables:
- a = <ArchivedAlarm: 509aa385f3b6827f400036bf>
- ManagedObjectAttribute = <class 'noc.sa.models.managedobject.ManagedObjectAttribute'>
- ac = <class 'noc.fm.models.ArchivedAlarm'>
- ArchivedEvent = <class 'noc.fm.models.ArchivedEvent'>
- NewEvent = <class 'noc.fm.models.NewEvent'>
- my_root = None
- o = <ManagedObject: cat->
- i = <Interface: cat-: Vl 58>
- self = <noc.main.management.commands.wipe.Command object at 0x807faa390>
- ArchivedAlarm = <class 'noc.fm.models.ArchivedAlarm'>
- MACDB = <class 'noc.inv.models.macdb.MACDB'>
- iac = <class 'noc.fm.models.ArchivedAlarm'>
- ForwardingInstance = <class 'noc.inv.models.forwardinginstance.ForwardingInstance'>
- Link = <class 'noc.inv.models.link.Link'>
- FailedEvent = <class 'noc.fm.models.FailedEvent'>
- ActiveAlarm = <class 'noc.fm.models.ActiveAlarm'>
- Address = <class 'noc.ip.models.address.Address'>
- Interface = <class 'noc.inv.models.interface.Interface'>
- ActiveEvent = <class 'noc.fm.models.ActiveEvent'>
- SubInterface = <class 'noc.inv.models.subinterface.SubInterface'>
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/wipe.py (Line: 47)
- Function: handle
- 40 raise CommandError("Object '%s' is not found" % o_id)
- 41 objects += [o]
- 42 # Wipe objects
- 43 from noc.lib.debug import error_report
- 44 for o in objects:
- 45 with self.log("Wiping '%s':" % unicode(o), True):
- 46 try:
- 47 ==> wiper(o)
- 48 except:
- 49 error_report()
- 50
- 51 @contextmanager
- 52 def log(self, message, newline=False):
- 53 """
- Variables:
- self = <noc.main.management.commands.wipe.Command object at 0x807faa390>
- args = ('managed-object', 'cat-')
- m = 'managed_object'
- o = <ManagedObject: cat->
- options = {'pythonpath': None, 'verbosity': '1', 'traceback': None, 'settings': None}
- objects = [<ManagedObject: cat->]
- getter = <bound method Command.get_managed_object of <noc.main.management.commands.wipe.Command object at 0x807faa390>>
- error_report = <function error_report at 0x803a47d70>
- wiper = <bound method Command.wipe_managed_object of <noc.main.management.commands.wipe.Command object at 0x807faa390>>
- o_id = 'cat-'
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment