Advertisement
Guest User

Untitled

a guest
Jan 10th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.09 KB | None | 0 0
  1. 2013-01-10 12:57:31,390 Periodic task=peer.prefix_list_provisioning:Any status=running
  2. 2013-01-10 12:57:31,404 UNHANDLED EXCEPTION (2013-01-10 12:57:31.390804)
  3. Working directory: /opt/noc
  4. <class 'mongoengine.queryset.InvalidQueryError'>
  5. Cannot resolve field "enable_prefix_list_provisioning"
  6. START OF TRACEBACK
  7. ------------------------------------------------------------------------
  8. File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 655)
  9. Function: _lookup_field
  10. 648 new_field = field.lookup_member(field_name)
  11. 649 from base import ComplexBaseField
  12. 650 if not new_field and isinstance(field, ComplexBaseField):
  13. 651 fields.append(field_name)
  14. 652 continue
  15. 653 elif not new_field:
  16. 654 raise InvalidQueryError('Cannot resolve field "%s"'
  17. 655 ==> % field_name)
  18. 656 field = new_field # update field to the new field type
  19. 657 fields.append(field)
  20. 658 return fields
  21. 659
  22. 660 @classmethod
  23. 661 def _translate_field_name(cls, doc_cls, field, sep='.'):
  24. Variables:
  25. document = <class 'noc.peer.models.PrefixListCache'>
  26. new_field = None
  27. field = <noc.lib.nosql.ForeignKeyField object at 0x42c0290>
  28. fields = [<noc.lib.nosql.ForeignKeyField object at 0x42c0290>]
  29. GenericReferenceField = <class 'mongoengine.fields.GenericReferenceField'>
  30. ComplexBaseField = <class 'mongoengine.base.ComplexBaseField'>
  31. parts = ['peering_point', 'enable_prefix_list_provisioning']
  32. ReferenceField = <class 'mongoengine.fields.ReferenceField'>
  33. field_name = 'enable_prefix_list_provisioning'
  34. cls = <class 'mongoengine.queryset.QuerySet'>
  35. ------------------------------------------------------------------------
  36. File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 701)
  37. Function: _transform_query
  38. 694 negate = False
  39. 695 if parts[-1] == 'not':
  40. 696 parts.pop()
  41. 697 negate = True
  42. 698
  43. 699 if _doc_cls:
  44. 700 # Switch field names to proper names [set in Field(name='foo')]
  45. 701 ==> fields = QuerySet._lookup_field(_doc_cls, parts)
  46. 702 parts = []
  47. 703
  48. 704 cleaned_fields = []
  49. 705 for field in fields:
  50. 706 append_field = True
  51. 707 if isinstance(field, basestring):
  52. Variables:
  53. mongo_query = {}
  54. _field_operation = False
  55. geo_operators = ['within_distance', 'within_spherical_distance', 'within_box', 'within_polygon', 'near', 'near_sphere']
  56. match_operators = ['contains', 'icontains', 'startswith', 'istartswith', 'endswith', 'iendswith', 'exact', 'iexact']
  57. p = 'enable_prefix_list_provisioning'
  58. i = 1
  59. operators = ['ne', 'gt', 'gte', 'lt', 'lte', 'in', 'nin', 'mod', 'all', 'size', 'exists', 'not']
  60. parts = ['peering_point', 'enable_prefix_list_provisioning']
  61. value = True
  62. indices = []
  63. _doc_cls = <class 'noc.peer.models.PrefixListCache'>
  64. part = 'enable_prefix_list_provisioning'
  65. cls = <class 'mongoengine.queryset.QuerySet'>
  66. key = 'peering_point__enable_prefix_list_provisioning'
  67. negate = False
  68. query = {'peering_point__enable_prefix_list_provisioning': True}
  69. custom_operators = ['match']
  70. op = None
  71. ------------------------------------------------------------------------
  72. File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 162)
  73. Function: visit_query
  74. 155 if combination.operation == combination.OR:
  75. 156 return {'$or': combination.children}
  76. 157 elif combination.operation == combination.AND:
  77. 158 return self._mongo_query_conjunction(combination.children)
  78. 159 return combination
  79. 160
  80. 161 def visit_query(self, query):
  81. 162 ==> return QuerySet._transform_query(self.document, **query.query)
  82. 163
  83. 164 def _mongo_query_conjunction(self, queries):
  84. 165 """Merges Mongo query dicts - effectively &ing them together.
  85. 166 """
  86. 167 combined_query = {}
  87. 168 for query in queries:
  88. Variables:
  89. query = <mongoengine.queryset.Q object at 0x442bb50>
  90. self = <mongoengine.queryset.QueryCompilerVisitor object at 0x4434310>
  91. ------------------------------------------------------------------------
  92. File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 270)
  93. Function: accept
  94. 263 query structures.
  95. 264 """
  96. 265
  97. 266 def __init__(self, **query):
  98. 267 self.query = query
  99. 268
  100. 269 def accept(self, visitor):
  101. 270 ==> return visitor.visit_query(self)
  102. 271
  103. 272 @property
  104. 273 def empty(self):
  105. 274 return not bool(self.query)
  106. 275
  107. 276
  108. Variables:
  109. visitor = <mongoengine.queryset.QueryCompilerVisitor object at 0x4434310>
  110. self = <mongoengine.queryset.Q object at 0x442bb50>
  111. ------------------------------------------------------------------------
  112. File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 205)
  113. Function: to_query
  114. 198
  115. 199 AND = 0
  116. 200 OR = 1
  117. 201
  118. 202 def to_query(self, document):
  119. 203 query = self.accept(SimplificationVisitor())
  120. 204 query = query.accept(QueryTreeTransformerVisitor())
  121. 205 ==> query = query.accept(QueryCompilerVisitor(document))
  122. 206 return query
  123. 207
  124. 208 def accept(self, visitor):
  125. 209 raise NotImplementedError
  126. 210
  127. 211 def _combine(self, other, operation):
  128. Variables:
  129. query = <mongoengine.queryset.Q object at 0x442bb50>
  130. self = <mongoengine.queryset.Q object at 0x442bb50>
  131. document = <class 'noc.peer.models.PrefixListCache'>
  132. ------------------------------------------------------------------------
  133. File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 379)
  134. Function: _query
  135. 372 setattr(c, prop, copy.deepcopy(val))
  136. 373
  137. 374 return c
  138. 375
  139. 376 @property
  140. 377 def _query(self):
  141. 378 if self._mongo_query is None:
  142. 379 ==> self._mongo_query = self._query_obj.to_query(self._document)
  143. 380 if self._class_check:
  144. 381 self._mongo_query.update(self._initial_query)
  145. 382 return self._mongo_query
  146. 383
  147. 384 def ensure_index(self, key_or_list, drop_dups=False, background=False,
  148. 385 **kwargs):
  149. Variables:
  150. self = repr() failed
  151. ------------------------------------------------------------------------
  152. File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 583)
  153. Function: _cursor
  154. 576 cursor_args['fields'] = self._loaded_fields.as_dict()
  155. 577 return cursor_args
  156. 578
  157. 579 @property
  158. 580 def _cursor(self):
  159. 581 if self._cursor_obj is None:
  160. 582
  161. 583 ==> self._cursor_obj = self._collection.find(self._query,
  162. 584 **self._cursor_args)
  163. 585 # Apply where clauses to cursor
  164. 586 if self._where_clause:
  165. 587 self._cursor_obj.where(self._where_clause)
  166. 588
  167. 589 # apply default ordering
  168. Variables:
  169. self = .. queryset mid-iteration ..
  170. ------------------------------------------------------------------------
  171. File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 990)
  172. Function: rewind
  173. 983
  174. 984 def rewind(self):
  175. 985 """Rewind the cursor to its unevaluated state.
  176. 986
  177. 987 .. versionadded:: 0.3
  178. 988 """
  179. 989 self._iter = False
  180. 990 ==> self._cursor.rewind()
  181. 991
  182. 992 def count(self):
  183. 993 """Count the selected elements in the query.
  184. 994 """
  185. 995 if self._limit == 0:
  186. 996 return 0
  187. Variables:
  188. self = .. queryset mid-iteration ..
  189. ------------------------------------------------------------------------
  190. File: /opt/noc/contrib/lib/mongoengine-0.6.20-py2.6.egg/mongoengine/queryset.py (Line: 1517)
  191. Function: __iter__
  192. 1510
  193. 1511 if ret is not None and 'n' in ret:
  194. 1512 return ret['n']
  195. 1513 except pymongo.errors.OperationFailure, e:
  196. 1514 raise OperationError(u'Update failed [%s]' % unicode(e))
  197. 1515
  198. 1516 def __iter__(self):
  199. 1517 ==> self.rewind()
  200. 1518 return self
  201. 1519
  202. 1520 def _get_scalar(self, doc):
  203. 1521
  204. 1522 def lookup(obj, name):
  205. 1523 chunks = name.split('__')
  206. Variables:
  207. self = .. queryset mid-iteration ..
  208. ------------------------------------------------------------------------
  209. File: /opt/noc/peer/periodics/prefix_list_provisioning.py (Line: 24)
  210. Function: execute
  211. 17 wait_for=["cm.prefix_list_pull"]
  212. 18 def execute(self):
  213. 19 from noc.peer.models import PrefixListCache
  214. 20 from noc.sa.models import ManagedObject,ReduceTask
  215. 21 #
  216. 22 prefix_lists={} # PeeringPoint -> [prefix_lists]
  217. 23 # For all out-of-dated prefix lists
  218. 24 ==> for pc in PrefixListCache.objects.filter(peering_point__enable_prefix_list_provisioning=True):
  219. 25 if pc.pushed is not None and pc.pushed>pc.changed:
  220. 26 continue
  221. 27 if not pc.data:
  222. 28 continue
  223. 29 if pc.peering_point not in prefix_lists:
  224. 30 prefix_lists[pc.peering_point]=[pc]
  225. Variables:
  226. self = <noc.peer.periodics.prefix_list_provisioning.Task object at 0x42c7b10>
  227. prefix_lists = {}
  228. ReduceTask = <class 'noc.sa.models.reducetask.ReduceTask'>
  229. PrefixListCache = <class 'noc.peer.models.PrefixListCache'>
  230. ManagedObject = <class 'noc.sa.models.managedobject.ManagedObject'>
  231. ------------------------------------------------------------------------
  232. File: /opt/noc/main/scheduler/periodic.py (Line: 74)
  233. Function: task_wrapper
  234. 67 t = datetime.datetime.now()
  235. 68 cwd = os.getcwd()
  236. 69 try:
  237. 70 if task.periodic_name.startswith("pyrule:"):
  238. 71 status = PyRule.call(task.periodic_name[7:],
  239. 72 timeout=task.timeout)
  240. 73 else:
  241. 74 ==> status = task.periodic(task.timeout).execute()
  242. 75 except:
  243. 76 error_report()
  244. 77 status = False
  245. 78 logging.info(u"Periodic task=%s status=%s" % (unicode(task),
  246. 79 "completed" if status else "failed"))
  247. 80 # Current path may be implicitly changed by periodic. Restore old value
  248. Variables:
  249. self = <PeriodicScheduler(Thread-1, started daemon 140476785936128)>
  250. task = <Schedule: peer.prefix_list_provisioning:Any>
  251. cwd = '/opt/noc'
  252. t = datetime.datetime(2013, 1, 10, 12, 57, 31, 390553)
  253. ------------------------------------------------------------------------
  254. END OF TRACEBACK
  255. 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