Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2013-01-10 12:57:31,390 Periodic task=peer.prefix_list_provisioning:Any status=running
- 2013-01-10 12:57:31,404 UNHANDLED EXCEPTION (2013-01-10 12:57:31.390804)
- Working directory: /opt/noc
- <class 'mongoengine.queryset.InvalidQueryError'>
- Cannot resolve field "enable_prefix_list_provisioning"
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 655)
- Function: _lookup_field
- 648 new_field = field.lookup_member(field_name)
- 649 from base import ComplexBaseField
- 650 if not new_field and isinstance(field, ComplexBaseField):
- 651 fields.append(field_name)
- 652 continue
- 653 elif not new_field:
- 654 raise InvalidQueryError('Cannot resolve field "%s"'
- 655 ==> % field_name)
- 656 field = new_field # update field to the new field type
- 657 fields.append(field)
- 658 return fields
- 659
- 660 @classmethod
- 661 def _translate_field_name(cls, doc_cls, field, sep='.'):
- Variables:
- document = <class 'noc.peer.models.PrefixListCache'>
- new_field = None
- field = <noc.lib.nosql.ForeignKeyField object at 0x42c0290>
- fields = [<noc.lib.nosql.ForeignKeyField object at 0x42c0290>]
- GenericReferenceField = <class 'mongoengine.fields.GenericReferenceField'>
- ComplexBaseField = <class 'mongoengine.base.ComplexBaseField'>
- parts = ['peering_point', 'enable_prefix_list_provisioning']
- ReferenceField = <class 'mongoengine.fields.ReferenceField'>
- field_name = 'enable_prefix_list_provisioning'
- cls = <class 'mongoengine.queryset.QuerySet'>
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 701)
- Function: _transform_query
- 694 negate = False
- 695 if parts[-1] == 'not':
- 696 parts.pop()
- 697 negate = True
- 698
- 699 if _doc_cls:
- 700 # Switch field names to proper names [set in Field(name='foo')]
- 701 ==> fields = QuerySet._lookup_field(_doc_cls, parts)
- 702 parts = []
- 703
- 704 cleaned_fields = []
- 705 for field in fields:
- 706 append_field = True
- 707 if isinstance(field, basestring):
- Variables:
- mongo_query = {}
- _field_operation = False
- geo_operators = ['within_distance', 'within_spherical_distance', 'within_box', 'within_polygon', 'near', 'near_sphere']
- match_operators = ['contains', 'icontains', 'startswith', 'istartswith', 'endswith', 'iendswith', 'exact', 'iexact']
- p = 'enable_prefix_list_provisioning'
- i = 1
- operators = ['ne', 'gt', 'gte', 'lt', 'lte', 'in', 'nin', 'mod', 'all', 'size', 'exists', 'not']
- parts = ['peering_point', 'enable_prefix_list_provisioning']
- value = True
- indices = []
- _doc_cls = <class 'noc.peer.models.PrefixListCache'>
- part = 'enable_prefix_list_provisioning'
- cls = <class 'mongoengine.queryset.QuerySet'>
- key = 'peering_point__enable_prefix_list_provisioning'
- negate = False
- query = {'peering_point__enable_prefix_list_provisioning': True}
- custom_operators = ['match']
- op = None
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 162)
- Function: visit_query
- 155 if combination.operation == combination.OR:
- 156 return {'$or': combination.children}
- 157 elif combination.operation == combination.AND:
- 158 return self._mongo_query_conjunction(combination.children)
- 159 return combination
- 160
- 161 def visit_query(self, query):
- 162 ==> return QuerySet._transform_query(self.document, **query.query)
- 163
- 164 def _mongo_query_conjunction(self, queries):
- 165 """Merges Mongo query dicts - effectively &ing them together.
- 166 """
- 167 combined_query = {}
- 168 for query in queries:
- Variables:
- query = <mongoengine.queryset.Q object at 0x442bb50>
- self = <mongoengine.queryset.QueryCompilerVisitor object at 0x4434310>
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 270)
- Function: accept
- 263 query structures.
- 264 """
- 265
- 266 def __init__(self, **query):
- 267 self.query = query
- 268
- 269 def accept(self, visitor):
- 270 ==> return visitor.visit_query(self)
- 271
- 272 @property
- 273 def empty(self):
- 274 return not bool(self.query)
- 275
- 276
- Variables:
- visitor = <mongoengine.queryset.QueryCompilerVisitor object at 0x4434310>
- self = <mongoengine.queryset.Q object at 0x442bb50>
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 205)
- Function: to_query
- 198
- 199 AND = 0
- 200 OR = 1
- 201
- 202 def to_query(self, document):
- 203 query = self.accept(SimplificationVisitor())
- 204 query = query.accept(QueryTreeTransformerVisitor())
- 205 ==> query = query.accept(QueryCompilerVisitor(document))
- 206 return query
- 207
- 208 def accept(self, visitor):
- 209 raise NotImplementedError
- 210
- 211 def _combine(self, other, operation):
- Variables:
- query = <mongoengine.queryset.Q object at 0x442bb50>
- self = <mongoengine.queryset.Q object at 0x442bb50>
- document = <class 'noc.peer.models.PrefixListCache'>
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 379)
- Function: _query
- 372 setattr(c, prop, copy.deepcopy(val))
- 373
- 374 return c
- 375
- 376 @property
- 377 def _query(self):
- 378 if self._mongo_query is None:
- 379 ==> self._mongo_query = self._query_obj.to_query(self._document)
- 380 if self._class_check:
- 381 self._mongo_query.update(self._initial_query)
- 382 return self._mongo_query
- 383
- 384 def ensure_index(self, key_or_list, drop_dups=False, background=False,
- 385 **kwargs):
- Variables:
- self = repr() failed
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 583)
- Function: _cursor
- 576 cursor_args['fields'] = self._loaded_fields.as_dict()
- 577 return cursor_args
- 578
- 579 @property
- 580 def _cursor(self):
- 581 if self._cursor_obj is None:
- 582
- 583 ==> self._cursor_obj = self._collection.find(self._query,
- 584 **self._cursor_args)
- 585 # Apply where clauses to cursor
- 586 if self._where_clause:
- 587 self._cursor_obj.where(self._where_clause)
- 588
- 589 # apply default ordering
- Variables:
- self = .. queryset mid-iteration ..
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 990)
- Function: rewind
- 983
- 984 def rewind(self):
- 985 """Rewind the cursor to its unevaluated state.
- 986
- 987 .. versionadded:: 0.3
- 988 """
- 989 self._iter = False
- 990 ==> self._cursor.rewind()
- 991
- 992 def count(self):
- 993 """Count the selected elements in the query.
- 994 """
- 995 if self._limit == 0:
- 996 return 0
- Variables:
- self = .. queryset mid-iteration ..
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 1517)
- Function: __iter__
- 1510
- 1511 if ret is not None and 'n' in ret:
- 1512 return ret['n']
- 1513 except pymongo.errors.OperationFailure, e:
- 1514 raise OperationError(u'Update failed [%s]' % unicode(e))
- 1515
- 1516 def __iter__(self):
- 1517 ==> self.rewind()
- 1518 return self
- 1519
- 1520 def _get_scalar(self, doc):
- 1521
- 1522 def lookup(obj, name):
- 1523 chunks = name.split('__')
- Variables:
- self = .. queryset mid-iteration ..
- ------------------------------------------------------------------------
- File: /opt/noc/peer/periodics/prefix_list_provisioning.py (Line: 24)
- Function: execute
- 17 wait_for=["cm.prefix_list_pull"]
- 18 def execute(self):
- 19 from noc.peer.models import PrefixListCache
- 20 from noc.sa.models import ManagedObject,ReduceTask
- 21 #
- 22 prefix_lists={} # PeeringPoint -> [prefix_lists]
- 23 # For all out-of-dated prefix lists
- 24 ==> for pc in PrefixListCache.objects.filter(peering_point__enable_prefix_list_provisioning=True):
- 25 if pc.pushed is not None and pc.pushed>pc.changed:
- 26 continue
- 27 if not pc.data:
- 28 continue
- 29 if pc.peering_point not in prefix_lists:
- 30 prefix_lists[pc.peering_point]=[pc]
- Variables:
- self = <noc.peer.periodics.prefix_list_provisioning.Task object at 0x42c7b10>
- prefix_lists = {}
- ReduceTask = <class 'noc.sa.models.reducetask.ReduceTask'>
- PrefixListCache = <class 'noc.peer.models.PrefixListCache'>
- ManagedObject = <class 'noc.sa.models.managedobject.ManagedObject'>
- ------------------------------------------------------------------------
- File: /opt/noc/main/scheduler/periodic.py (Line: 74)
- Function: task_wrapper
- 67 t = datetime.datetime.now()
- 68 cwd = os.getcwd()
- 69 try:
- 70 if task.periodic_name.startswith("pyrule:"):
- 71 status = PyRule.call(task.periodic_name[7:],
- 72 timeout=task.timeout)
- 73 else:
- 74 ==> status = task.periodic(task.timeout).execute()
- 75 except:
- 76 error_report()
- 77 status = False
- 78 logging.info(u"Periodic task=%s status=%s" % (unicode(task),
- 79 "completed" if status else "failed"))
- 80 # Current path may be implicitly changed by periodic. Restore old value
- Variables:
- self = <PeriodicScheduler(Thread-1, started daemon 140476785936128)>
- task = <Schedule: peer.prefix_list_provisioning:Any>
- cwd = '/opt/noc'
- t = datetime.datetime(2013, 1, 10, 12, 57, 31, 390553)
- ------------------------------------------------------------------------
- END OF TRACEBACK
- 2013-01-10 12:57:31,405 Periodic task=peer.prefix_list_provisioning:Any status=failed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement