Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Working directory: /opt/noc
- <class 'mongoengine.errors.InvalidQueryError'>
- Cannot resolve field "managed_object"
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /usr/lib/python2.7/site-packages/mongoengine/queryset/transform.py (Line: 59)
- Function: query
- 52 negate = True
- 53
- 54 if _doc_cls:
- 55 # Switch field names to proper names [set in Field(name='foo')]
- 56 try:
- 57 fields = _doc_cls._lookup_field(parts)
- 58 except Exception, e:
- 59 ==> raise InvalidQueryError(e)
- 60 parts = []
- 61
- 62 cleaned_fields = []
- 63 for field in fields:
- 64 append_field = True
- 65 if isinstance(field, basestring):
- Variables:
- mongo_query = {}
- _field_operation = False
- e = LookUpError('Cannot resolve field "managed_object"',)
- p = 'managed_object'
- i = 0
- parts = ['managed_object']
- value = <ManagedObject: wiping-7>
- indices = []
- _doc_cls = <class 'noc.sa.models.objectcapabilities.ObjectCapabilities'>
- part = 'managed_object'
- key = 'managed_object'
- negate = False
- query = {'managed_object': <ManagedObject: wiping-7>}
- merge_query = defaultdict(<type 'list'>, {})
- op = None
- ------------------------------------------------------------------------
- File: /usr/lib/python2.7/site-packages/mongoengine/queryset/visitor.py (Line: 80)
- Function: visit_query
- 73 def visit_combination(self, combination):
- 74 operator = "$and"
- 75 if combination.operation == combination.OR:
- 76 operator = "$or"
- 77 return {operator: combination.children}
- 78
- 79 def visit_query(self, query):
- 80 ==> return transform.query(self.document, **query.query)
- 81
- 82
- 83 class QNode(object):
- 84 """Base class for nodes in query trees.
- 85 """
- 86
- Variables:
- query = <mongoengine.queryset.visitor.Q object at 0x7ff726646410>
- self =
- <mongoengine.queryset.visitor.QueryCompilerVisitor object at 0x7ff7266464d0>
- ------------------------------------------------------------------------
- File: /usr/lib/python2.7/site-packages/mongoengine/queryset/visitor.py (Line: 157)
- Function: accept
- 150 query structures.
- 151 """
- 152
- 153 def __init__(self, **query):
- 154 self.query = query
- 155
- 156 def accept(self, visitor):
- 157 ==> return visitor.visit_query(self)
- 158
- 159 @property
- 160 def empty(self):
- 161 return not bool(self.query)
- Variables:
- visitor =
- <mongoengine.queryset.visitor.QueryCompilerVisitor object at 0x7ff7266464d0>
- self = <mongoengine.queryset.visitor.Q object at 0x7ff726646410>
- ------------------------------------------------------------------------
- File: /usr/lib/python2.7/site-packages/mongoengine/queryset/visitor.py (Line: 92)
- Function: to_query
- 85 """
- 86
- 87 AND = 0
- 88 OR = 1
- 89
- 90 def to_query(self, document):
- 91 query = self.accept(SimplificationVisitor())
- 92 ==> query = query.accept(QueryCompilerVisitor(document))
- 93 return query
- 94
- 95 def accept(self, visitor):
- 96 raise NotImplementedError
- 97
- 98 def _combine(self, other, operation):
- Variables:
- query = <mongoengine.queryset.visitor.Q object at 0x7ff726646410>
- self = <mongoengine.queryset.visitor.Q object at 0x7ff726646410>
- document = <class 'noc.sa.models.objectcapabilities.ObjectCapabilities'>
- ------------------------------------------------------------------------
- File: /usr/lib/python2.7/site-packages/mongoengine/queryset/base.py (Line: 1215)
- Function: _query
- 1208 def __deepcopy__(self, memo):
- 1209 """Essential for chained queries with ReferenceFields involved"""
- 1210 return self.clone()
- 1211
- 1212 @property
- 1213 def _query(self):
- 1214 if self._mongo_query is None:
- 1215 ==> self._mongo_query = self._query_obj.to_query(self._document)
- 1216 if self._class_check:
- 1217 self._mongo_query.update(self._initial_query)
- 1218 return self._mongo_query
- 1219
- 1220 @property
- 1221 def _dereference(self):
- Variables:
- self = repr() failed
- ------------------------------------------------------------------------
- File: /usr/lib/python2.7/site-packages/mongoengine/queryset/base.py (Line: 402)
- Function: delete
- 395 document_cls.objects(**{field_name + '__in': self}).update(
- 396 write_concern=write_concern, **{'unset__%s' % field_name: 1})
- 397 elif rule == PULL:
- 398 document_cls.objects(**{field_name + '__in': self}).update(
- 399 write_concern=write_concern,
- 400 **{'pull_all__%s' % field_name: self})
- 401
- 402 ==> queryset._collection.remove(queryset._query, write_concern=write_concern)
- 403
- 404 def update(self, upsert=False, multi=True, write_concern=None,
- 405 full_result=False, **update):
- 406 """Perform an atomic update on the fields matched by the query.
- 407
- 408 :param upsert: Any existing document with that "_id" is overwritten.
- Variables:
- doc = <class 'noc.sa.models.objectcapabilities.ObjectCapabilities'>
- self = repr() failed
- queryset = repr() failed
- has_delete_signal = False
- _from_doc_delete = False
- delete_rules = {}
- call_document_delete = False
- write_concern = {}
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/wipe.py (Line: 170)
- Function: wipe_managed_object
- 163 with self.log("Deleting map tasks"):
- 164 MapTask.objects.filter(managed_object=o).delete()
- 165 # Delete Managed Object's attributes
- 166 with self.log("Deleting object's attributes"):
- 167 ManagedObjectAttribute.objects.filter(managed_object=o).delete()
- 168 # Delete object's capabilities
- 169 with self.log("Deletion object's capabilities"):
- 170 ==> ObjectCapabilities.objects.filter(managed_object=o).delete()
- 171 # Finally delete object and config
- 172 with self.log("Deleting managed object and config"):
- 173 o.delete()
- 174
- 175 def get_user(self, u_id):
- 176 """
- Variables:
- ManagedObjectAttribute = <class 'noc.sa.models.managedobject.ManagedObjectAttribute'>
- o = <ManagedObject: wiping-7>
- ac = <class 'noc.fm.models.archivedalarm.ArchivedAlarm'>
- ArchivedEvent = <class 'noc.fm.models.archivedevent.ArchivedEvent'>
- NewEvent = <class 'noc.fm.models.newevent.NewEvent'>
- MapTask = <class 'noc.sa.models.maptask.MapTask'>
- self = <noc.main.management.commands.wipe.Command object at 0x7ff726663750>
- ArchivedAlarm = <class 'noc.fm.models.archivedalarm.ArchivedAlarm'>
- MACDB = <class 'noc.inv.models.macdb.MACDB'>
- FailedEvent = <class 'noc.fm.models.failedevent.FailedEvent'>
- ForwardingInstance = <class 'noc.inv.models.forwardinginstance.ForwardingInstance'>
- Link = <class 'noc.inv.models.link.Link'>
- DiscoveryID = <class 'noc.inv.models.discoveryid.DiscoveryID'>
- ActiveAlarm = <class 'noc.fm.models.activealarm.ActiveAlarm'>
- Address = <class 'noc.ip.models.address.Address'>
- Interface = <class 'noc.inv.models.interface.Interface'>
- ActiveEvent = <class 'noc.fm.models.activeevent.ActiveEvent'>
- PendingLinkCheck = <class 'noc.inv.models.pendinglinkcheck.PendingLinkCheck'>
- ObjectCapabilities = <class 'noc.sa.models.objectcapabilities.ObjectCapabilities'>
- 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 0x7ff726663750>
- args = ('managed_object', 'wiping-7')
- m = 'managed_object'
- o = <ManagedObject: wiping-7>
- options =
- {'pythonpath': None, 'settings': None, 'traceback': None, 'verbosity': '1'}
- objects = [<ManagedObject: wiping-7>]
- getter =
- <bound method Command.get_managed_object of <noc.main.management.commands.wipe.Command object at 0x7ff726663750>>
- error_report = <function error_report at 0x7ff73b2dcf50>
- wiper =
- <bound method Command.wipe_managed_object of <noc.main.management.commands.wipe.Command object at 0x7ff726663750>>
- o_id = 'wiping-7'
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement