Advertisement
Guest User

Untitled

a guest
Sep 8th, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.26 KB | None | 0 0
  1. ERROR:noc.lib.debug:UNHANDLED EXCEPTION (2014-09-08 23:11:00.495206)
  2. Working directory: /opt/noc
  3. <type 'exceptions.TypeError'>
  4. clean() takes exactly 2 arguments (1 given)
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/lib/python2.7/site-packages/mongoengine/base/document.py (Line: 289)
  8. Function: validate
  9. 282 """Ensure that all fields' values are valid and that required fields
  10. 283 are present.
  11. 284 """
  12. 285 # Ensure that each field is matched to a valid value
  13. 286 errors = {}
  14. 287 if clean:
  15. 288 try:
  16. 289 ==> self.clean()
  17. 290 except ValidationError, error:
  18. 291 errors[NON_FIELD_ERRORS] = error
  19. 292
  20. 293 # Get a list of tuples of field names and their current values
  21. 294 fields = [(self._fields.get(name, self._dynamic_fields.get(name)),
  22. 295 self._data.get(name)) for name in self._fields_ordered]
  23. Variables:
  24. self = <ModelInterfaceAttr: level>
  25. errors = {}
  26. clean = True
  27. ------------------------------------------------------------------------
  28. File: /opt/noc/lib/python2.7/site-packages/mongoengine/fields.py (Line: 567)
  29. Function: validate
  30. 560 """Make sure that the document instance is an instance of the
  31. 561 EmbeddedDocument subclass provided when the document was defined.
  32. 562 """
  33. 563 # Using isinstance also works for subclasses of self.document
  34. 564 if not isinstance(value, self.document_type):
  35. 565 self.error('Invalid embedded document instance provided to an '
  36. 566 'EmbeddedDocumentField')
  37. 567 ==> self.document_type.validate(value, clean)
  38. 568
  39. 569 def lookup_member(self, member_name):
  40. 570 return self.document_type._fields.get(member_name)
  41. 571
  42. 572 def prepare_query_value(self, op, value):
  43. 573 return self.to_mongo(value)
  44. Variables:
  45. self = <mongoengine.fields.EmbeddedDocumentField object at 0x33a2810>
  46. value = <ModelInterfaceAttr: level>
  47. clean = True
  48. ------------------------------------------------------------------------
  49. File: /opt/noc/lib/python2.7/site-packages/mongoengine/base/fields.py (Line: 174)
  50. Function: _validate
  51. 167 if callable(self.validation):
  52. 168 if not self.validation(value):
  53. 169 self.error('Value does not match custom validation method')
  54. 170 else:
  55. 171 raise ValueError('validation argument for "%s" must be a '
  56. 172 'callable.' % self.name)
  57. 173
  58. 174 ==> self.validate(value, **kwargs)
  59. 175
  60. 176
  61. 177 class ComplexBaseField(BaseField):
  62. 178 """Handles complex fields, such as lists / dictionaries.
  63. 179
  64. 180 Allows for nesting of embedded documents inside complex types.
  65. Variables:
  66. self = <mongoengine.fields.EmbeddedDocumentField object at 0x33a2810>
  67. Document = <class 'mongoengine.document.Document'>
  68. EmbeddedDocument = <class 'mongoengine.document.EmbeddedDocument'>
  69. value = <ModelInterfaceAttr: level>
  70. kwargs = {}
  71. ------------------------------------------------------------------------
  72. File: /opt/noc/lib/python2.7/site-packages/mongoengine/base/fields.py (Line: 353)
  73. Function: validate
  74. 346 if self.field:
  75. 347 if hasattr(value, 'iteritems') or hasattr(value, 'items'):
  76. 348 sequence = value.iteritems()
  77. 349 else:
  78. 350 sequence = enumerate(value)
  79. 351 for k, v in sequence:
  80. 352 try:
  81. 353 ==> self.field._validate(v)
  82. 354 except ValidationError, error:
  83. 355 errors[k] = error.errors or error
  84. 356 except (ValueError, AssertionError), error:
  85. 357 errors[k] = error
  86. 358
  87. 359 if errors:
  88. Variables:
  89. errors = {}
  90. sequence = <enumerate object at 0x3ae80f0>
  91. self = <mongoengine.fields.ListField object at 0x33a2850>
  92. value = [<ModelInterfaceAttr: level>]
  93. v = <ModelInterfaceAttr: level>
  94. k = 0
  95. ------------------------------------------------------------------------
  96. File: /opt/noc/lib/python2.7/site-packages/mongoengine/fields.py (Line: 698)
  97. Function: validate
  98. 691
  99. 692 def validate(self, value):
  100. 693 """Make sure that a list of valid fields is being used.
  101. 694 """
  102. 695 if (not isinstance(value, (list, tuple, QuerySet)) or
  103. 696 isinstance(value, basestring)):
  104. 697 self.error('Only lists and tuples may be used in a list field')
  105. 698 ==> super(ListField, self).validate(value)
  106. 699
  107. 700 def prepare_query_value(self, op, value):
  108. 701 if self.field:
  109. 702 if op in ('set', 'unset') and (not isinstance(value, basestring)
  110. 703 and not isinstance(value, BaseDocument)
  111. 704 and hasattr(value, '__iter__')):
  112. Variables:
  113. self = <mongoengine.fields.ListField object at 0x33a2850>
  114. value = [<ModelInterfaceAttr: level>]
  115. ------------------------------------------------------------------------
  116. File: /opt/noc/lib/python2.7/site-packages/mongoengine/base/fields.py (Line: 174)
  117. Function: _validate
  118. 167 if callable(self.validation):
  119. 168 if not self.validation(value):
  120. 169 self.error('Value does not match custom validation method')
  121. 170 else:
  122. 171 raise ValueError('validation argument for "%s" must be a '
  123. 172 'callable.' % self.name)
  124. 173
  125. 174 ==> self.validate(value, **kwargs)
  126. 175
  127. 176
  128. 177 class ComplexBaseField(BaseField):
  129. 178 """Handles complex fields, such as lists / dictionaries.
  130. 179
  131. 180 Allows for nesting of embedded documents inside complex types.
  132. Variables:
  133. self = <mongoengine.fields.ListField object at 0x33a2850>
  134. Document = <class 'mongoengine.document.Document'>
  135. EmbeddedDocument = <class 'mongoengine.document.EmbeddedDocument'>
  136. value = [<ModelInterfaceAttr: level>]
  137. kwargs = {}
  138. ------------------------------------------------------------------------
  139. File: /opt/noc/lib/python2.7/site-packages/mongoengine/base/document.py (Line: 307)
  140. Function: validate
  141. 300 for field, value in fields:
  142. 301 if value is not None:
  143. 302 try:
  144. 303 if isinstance(field, (EmbeddedDocumentField,
  145. 304 GenericEmbeddedDocumentField)):
  146. 305 field._validate(value, clean=clean)
  147. 306 else:
  148. 307 ==> field._validate(value)
  149. 308 except ValidationError, error:
  150. 309 errors[field.name] = error.errors or error
  151. 310 except (ValueError, AttributeError, AssertionError), error:
  152. 311 errors[field.name] = error
  153. 312 elif field.required and not getattr(field, '_auto_gen', False):
  154. 313 errors[field.name] = ValidationError('Field is required',
  155. Variables:
  156. errors = {}
  157. name = 'uuid'
  158. EmbeddedDocumentField = <class 'mongoengine.fields.EmbeddedDocumentField'>
  159. fields =
  160. [(<mongoengine.base.fields.ObjectIdField object at 0x33a2910>, None),
  161. (<mongoengine.fields.StringField object at 0x33a2710>, u'pop'),
  162. (<mongoengine.fields.StringField object at 0x33a27d0>, u'Point of Presence'),
  163. (<mongoengine.fields.ListField object at 0x33a2850>,
  164. [<ModelInterfaceAttr: level>]),
  165. (<mongoengine.fields.UUIDField object at 0x33a2890>,
  166. '0f161fa9-5b69-4bbe-9efb-c6f80814305a')]
  167. self = <ModelInterface: pop>
  168. GenericEmbeddedDocumentField = <class 'mongoengine.fields.GenericEmbeddedDocumentField'>
  169. field = <mongoengine.fields.ListField object at 0x33a2850>
  170. value = [<ModelInterfaceAttr: level>]
  171. clean = True
  172. ------------------------------------------------------------------------
  173. File: /opt/noc/lib/python2.7/site-packages/mongoengine/document.py (Line: 224)
  174. Function: save
  175. 217 meta['cascade'] = True. Also you can pass different kwargs to
  176. 218 the cascade save using cascade_kwargs which overwrites the
  177. 219 existing kwargs with custom values.
  178. 220 """
  179. 221 signals.pre_save.send(self.__class__, document=self)
  180. 222
  181. 223 if validate:
  182. 224 ==> self.validate(clean=clean)
  183. 225
  184. 226 if write_concern is None:
  185. 227 write_concern = {"w": 1}
  186. 228
  187. 229 doc = self.to_mongo()
  188. 230
  189. Variables:
  190. cascade_kwargs = None
  191. force_insert = False
  192. self = <ModelInterface: pop>
  193. _refs = None
  194. cascade = None
  195. write_concern = None
  196. clean = True
  197. kwargs = {}
  198. validate = True
  199. ------------------------------------------------------------------------
  200. File: /opt/noc/lib/collection.py (Line: 211)
  201. Function: update_item
  202. 204 # Update fields
  203. 205 for k in d:
  204. 206 setattr(o, k, d[k])
  205. 207 o.save()
  206. 208 else:
  207. 209 # Create item
  208. 210 o = self.doc(**d)
  209. 211 ==> o.save()
  210. 212 self.items[mi.uuid] = mi
  211. 213 self.changed = True
  212. 214
  213. 215 def lookup(self, ref, field, key):
  214. 216 field = str(field)
  215. 217 if ref not in self.ref_cache:
  216. Variables:
  217. mi =
  218. CollectionItem(name='pop', uuid='0f161fa9-5b69-4bbe-9efb-c6f80814305a', path='pop.json', hash='88dc37dab4ce24f03336d1b02472905f6121330a5f0014dba6e0828f59bb3a2f')
  219. self = <noc.lib.collection.Collection object at 0x3ad4ed0>
  220. data =
  221. {'attrs': [{'description': 'PoP level',
  222. 'is_const': True,
  223. 'name': 'level',
  224. 'required': True,
  225. 'type': 'int'}],
  226. 'description': 'Point of Presence',
  227. 'name': 'pop',
  228. 'uuid': '0f161fa9-5b69-4bbe-9efb-c6f80814305a'}
  229. d =
  230. {'attrs': [<ModelInterfaceAttr: level>],
  231. 'description': 'Point of Presence',
  232. 'name': 'pop',
  233. 'uuid': '0f161fa9-5b69-4bbe-9efb-c6f80814305a'}
  234. o = <ModelInterface: pop>
  235. ------------------------------------------------------------------------
  236. File: /opt/noc/lib/collection.py (Line: 162)
  237. Function: apply
  238. 155 sr = set(collection.items)
  239. 156 # Delete revoked items
  240. 157 for i in collection.get_revoked_items():
  241. 158 if i in self.items:
  242. 159 self.delete_item(i)
  243. 160 # Check for new items
  244. 161 for i in sr - sl:
  245. 162 ==> self.update_item(collection.items[i])
  246. 163 # Update changed items
  247. 164 for i in sr & sl:
  248. 165 if self.items[i].hash != collection.items[i].hash:
  249. 166 self.update_item(collection.items[i])
  250. 167 # Update partial items
  251. 168 for i in self.partial:
  252. Variables:
  253. i = '0f161fa9-5b69-4bbe-9efb-c6f80814305a'
  254. sr =
  255. set(['0aef5942-e41a-4acf-ab3e-5bc406aaee08',
  256. '0f161fa9-5b69-4bbe-9efb-c6f80814305a',
  257. '15c0da42-dd46-4a3b-b420-1798c8014517',
  258. '18fccfab-16c0-498f-9f6c-ae034a361bcd',
  259. '22e46608-0ed9-4822-b80f-d833a7f05e35',
  260. '2a928f8d-4380-4d0a-83c4-1f00c9536484',
  261. '2bfdfe3a-78dc-429c-99c7-a3db73d3e491',
  262. '62b945a4-ebf6-4174-94a7-c77e327d16d4',
  263. '6aa71d8c-c4c7-4cca-91a5-3fc1af708f65',
  264. 'a15da7b7-98de-4843-b256-0da049137833',
  265. 'a3c13162-a7bf-420c-99e3-5977a5f0f47e',
  266. 'b20b514d-954b-4fcc-b783-19328277c289',
  267. 'b26d8388-0450-4c30-886d-d3d6da86c401',
  268. 'ba30451d-61f6-4fff-9443-f3ebfe30bbfe',
  269. 'c3cb0577-9ed2-4edb-b3e3-eaca6f1fed38',
  270. 'e8e9a35f-d051-4b11-8e0b-0d14dcbdffb1',
  271. 'f7a27faf-3b5d-45a6-b3f3-bedf20ea3337'])
  272. self = <noc.lib.collection.Collection object at 0x3ad4ed0>
  273. collection = <noc.lib.collection.Collection object at 0x3ad4c90>
  274. sl = set([])
  275. ------------------------------------------------------------------------
  276. File: /opt/noc/main/management/commands/collection.py (Line: 175)
  277. Function: handle_sync
  278. 168 DocCategory.fix_all()
  279. 169 try:
  280. 170 for name, doc in self.collections:
  281. 171 lc = Collection(name, doc, local=True)
  282. 172 lc.load()
  283. 173 dc = Collection(name, doc)
  284. 174 dc.load()
  285. 175 ==> lc.apply(dc)
  286. 176 except ValueError, why:
  287. 177 raise CommandError(why)
  288. 178 except DereferenceError, why:
  289. 179 raise CommandError(why)
  290. 180
  291. 181 def handle_upgrade(self, collections):
  292. Variables:
  293. doc = <class 'noc.inv.models.modelinterface.ModelInterface'>
  294. self = <noc.main.management.commands.collection.Command object at 0x38be410>
  295. dc = <noc.lib.collection.Collection object at 0x3ad4c90>
  296. name = 'inv.modelinterfaces'
  297. lc = <noc.lib.collection.Collection object at 0x3ad4ed0>
  298. ------------------------------------------------------------------------
  299. File: /opt/noc/main/management/commands/collection.py (Line: 139)
  300. Function: _handle
  301. 132 raise
  302. 133 except:
  303. 134 error_report()
  304. 135
  305. 136 def _handle(self, *args, **options):
  306. 137 self.verbose = bool(options.get("verbosity"))
  307. 138 if options["cmd"] == "sync":
  308. 139 ==> return self.handle_sync()
  309. 140 elif options["cmd"] == "upgrade":
  310. 141 return self.handle_upgrade(args)
  311. 142 elif options["cmd"] == "install":
  312. 143 if len(args) < 2:
  313. 144 parts = args[0].split(os.path.sep)
  314. 145 if (len(parts) < 2 or parts[1] != "collections"):
  315. Variables:
  316. self = <noc.main.management.commands.collection.Command object at 0x38be410>
  317. args = ()
  318. options =
  319. {'cmd': 'sync',
  320. 'pythonpath': None,
  321. 'settings': None,
  322. 'traceback': None,
  323. 'verbosity': '1'}
  324. ------------------------------------------------------------------------
  325. File: /opt/noc/main/management/commands/collection.py (Line: 130)
  326. Function: handle
  327. 123 msg = "%s\nAvailable collections:" % msg
  328. 124 for n, d in self.collections:
  329. 125 msg = "%s\n %s" % (msg, n)
  330. 126 return msg
  331. 127
  332. 128 def handle(self, *args, **kwargs):
  333. 129 try:
  334. 130 ==> self._handle(*args, **kwargs)
  335. 131 except CommandError:
  336. 132 raise
  337. 133 except:
  338. 134 error_report()
  339. 135
  340. 136 def _handle(self, *args, **options):
  341. Variables:
  342. self = <noc.main.management.commands.collection.Command object at 0x38be410>
  343. args = ()
  344. kwargs =
  345. {'cmd': 'sync',
  346. 'pythonpath': None,
  347. 'settings': None,
  348. 'traceback': None,
  349. 'verbosity': '1'}
  350. ------------------------------------------------------------------------
  351. END OF TRACEBACK
  352. Updating manifests
  353. Traceback (most recent call last):
  354. File "manage.py", line 35, in <module>
  355. import noc.urls
  356. File "/opt/noc/urls.py", line 18, in <module>
  357. site.autodiscover()
  358. File "/opt/noc/lib/app/site.py", line 464, in autodiscover
  359. {}, {}, "*")
  360. File "/opt/noc/inv/apps/inv/views.py", line 21, in <module>
  361. class InvApplication(ExtApplication):
  362. File "/opt/noc/lib/app/application.py", line 105, in __new__
  363. site.register(m)
  364. File "/opt/noc/lib/app/site.py", line 379, in register
  365. app = app_class(self)
  366. File "/opt/noc/inv/apps/inv/views.py", line 52, in __init__
  367. self.plugins[o.name] = o(self)
  368. File "/opt/noc/inv/apps/inv/plugins/base.py", line 18, in __init__
  369. self.init_plugin()
  370. File "/opt/noc/inv/apps/inv/plugins/conduits.py", line 61, in init_plugin
  371. self.conduits_model = ObjectModel.objects.get(name=self.CONDUITS_MODEL)
  372. File "/opt/noc/lib/python2.7/site-packages/mongoengine/queryset/base.py", line 186, in get
  373. raise queryset._document.DoesNotExist(msg)
  374. noc.inv.models.objectmodel.DoesNotExist: ObjectModel matching query does not exist.
  375. upgrade-user: 53: failed to update manifests
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement