Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ERROR:noc.lib.debug:UNHANDLED EXCEPTION (2014-09-08 23:11:00.495206)
- Working directory: /opt/noc
- <type 'exceptions.TypeError'>
- clean() takes exactly 2 arguments (1 given)
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/base/document.py (Line: 289)
- Function: validate
- 282 """Ensure that all fields' values are valid and that required fields
- 283 are present.
- 284 """
- 285 # Ensure that each field is matched to a valid value
- 286 errors = {}
- 287 if clean:
- 288 try:
- 289 ==> self.clean()
- 290 except ValidationError, error:
- 291 errors[NON_FIELD_ERRORS] = error
- 292
- 293 # Get a list of tuples of field names and their current values
- 294 fields = [(self._fields.get(name, self._dynamic_fields.get(name)),
- 295 self._data.get(name)) for name in self._fields_ordered]
- Variables:
- self = <ModelInterfaceAttr: level>
- errors = {}
- clean = True
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/fields.py (Line: 567)
- Function: validate
- 560 """Make sure that the document instance is an instance of the
- 561 EmbeddedDocument subclass provided when the document was defined.
- 562 """
- 563 # Using isinstance also works for subclasses of self.document
- 564 if not isinstance(value, self.document_type):
- 565 self.error('Invalid embedded document instance provided to an '
- 566 'EmbeddedDocumentField')
- 567 ==> self.document_type.validate(value, clean)
- 568
- 569 def lookup_member(self, member_name):
- 570 return self.document_type._fields.get(member_name)
- 571
- 572 def prepare_query_value(self, op, value):
- 573 return self.to_mongo(value)
- Variables:
- self = <mongoengine.fields.EmbeddedDocumentField object at 0x33a2810>
- value = <ModelInterfaceAttr: level>
- clean = True
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/base/fields.py (Line: 174)
- Function: _validate
- 167 if callable(self.validation):
- 168 if not self.validation(value):
- 169 self.error('Value does not match custom validation method')
- 170 else:
- 171 raise ValueError('validation argument for "%s" must be a '
- 172 'callable.' % self.name)
- 173
- 174 ==> self.validate(value, **kwargs)
- 175
- 176
- 177 class ComplexBaseField(BaseField):
- 178 """Handles complex fields, such as lists / dictionaries.
- 179
- 180 Allows for nesting of embedded documents inside complex types.
- Variables:
- self = <mongoengine.fields.EmbeddedDocumentField object at 0x33a2810>
- Document = <class 'mongoengine.document.Document'>
- EmbeddedDocument = <class 'mongoengine.document.EmbeddedDocument'>
- value = <ModelInterfaceAttr: level>
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/base/fields.py (Line: 353)
- Function: validate
- 346 if self.field:
- 347 if hasattr(value, 'iteritems') or hasattr(value, 'items'):
- 348 sequence = value.iteritems()
- 349 else:
- 350 sequence = enumerate(value)
- 351 for k, v in sequence:
- 352 try:
- 353 ==> self.field._validate(v)
- 354 except ValidationError, error:
- 355 errors[k] = error.errors or error
- 356 except (ValueError, AssertionError), error:
- 357 errors[k] = error
- 358
- 359 if errors:
- Variables:
- errors = {}
- sequence = <enumerate object at 0x3ae80f0>
- self = <mongoengine.fields.ListField object at 0x33a2850>
- value = [<ModelInterfaceAttr: level>]
- v = <ModelInterfaceAttr: level>
- k = 0
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/fields.py (Line: 698)
- Function: validate
- 691
- 692 def validate(self, value):
- 693 """Make sure that a list of valid fields is being used.
- 694 """
- 695 if (not isinstance(value, (list, tuple, QuerySet)) or
- 696 isinstance(value, basestring)):
- 697 self.error('Only lists and tuples may be used in a list field')
- 698 ==> super(ListField, self).validate(value)
- 699
- 700 def prepare_query_value(self, op, value):
- 701 if self.field:
- 702 if op in ('set', 'unset') and (not isinstance(value, basestring)
- 703 and not isinstance(value, BaseDocument)
- 704 and hasattr(value, '__iter__')):
- Variables:
- self = <mongoengine.fields.ListField object at 0x33a2850>
- value = [<ModelInterfaceAttr: level>]
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/base/fields.py (Line: 174)
- Function: _validate
- 167 if callable(self.validation):
- 168 if not self.validation(value):
- 169 self.error('Value does not match custom validation method')
- 170 else:
- 171 raise ValueError('validation argument for "%s" must be a '
- 172 'callable.' % self.name)
- 173
- 174 ==> self.validate(value, **kwargs)
- 175
- 176
- 177 class ComplexBaseField(BaseField):
- 178 """Handles complex fields, such as lists / dictionaries.
- 179
- 180 Allows for nesting of embedded documents inside complex types.
- Variables:
- self = <mongoengine.fields.ListField object at 0x33a2850>
- Document = <class 'mongoengine.document.Document'>
- EmbeddedDocument = <class 'mongoengine.document.EmbeddedDocument'>
- value = [<ModelInterfaceAttr: level>]
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/base/document.py (Line: 307)
- Function: validate
- 300 for field, value in fields:
- 301 if value is not None:
- 302 try:
- 303 if isinstance(field, (EmbeddedDocumentField,
- 304 GenericEmbeddedDocumentField)):
- 305 field._validate(value, clean=clean)
- 306 else:
- 307 ==> field._validate(value)
- 308 except ValidationError, error:
- 309 errors[field.name] = error.errors or error
- 310 except (ValueError, AttributeError, AssertionError), error:
- 311 errors[field.name] = error
- 312 elif field.required and not getattr(field, '_auto_gen', False):
- 313 errors[field.name] = ValidationError('Field is required',
- Variables:
- errors = {}
- name = 'uuid'
- EmbeddedDocumentField = <class 'mongoengine.fields.EmbeddedDocumentField'>
- fields =
- [(<mongoengine.base.fields.ObjectIdField object at 0x33a2910>, None),
- (<mongoengine.fields.StringField object at 0x33a2710>, u'pop'),
- (<mongoengine.fields.StringField object at 0x33a27d0>, u'Point of Presence'),
- (<mongoengine.fields.ListField object at 0x33a2850>,
- [<ModelInterfaceAttr: level>]),
- (<mongoengine.fields.UUIDField object at 0x33a2890>,
- '0f161fa9-5b69-4bbe-9efb-c6f80814305a')]
- self = <ModelInterface: pop>
- GenericEmbeddedDocumentField = <class 'mongoengine.fields.GenericEmbeddedDocumentField'>
- field = <mongoengine.fields.ListField object at 0x33a2850>
- value = [<ModelInterfaceAttr: level>]
- clean = True
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/document.py (Line: 224)
- Function: save
- 217 meta['cascade'] = True. Also you can pass different kwargs to
- 218 the cascade save using cascade_kwargs which overwrites the
- 219 existing kwargs with custom values.
- 220 """
- 221 signals.pre_save.send(self.__class__, document=self)
- 222
- 223 if validate:
- 224 ==> self.validate(clean=clean)
- 225
- 226 if write_concern is None:
- 227 write_concern = {"w": 1}
- 228
- 229 doc = self.to_mongo()
- 230
- Variables:
- cascade_kwargs = None
- force_insert = False
- self = <ModelInterface: pop>
- _refs = None
- cascade = None
- write_concern = None
- clean = True
- kwargs = {}
- validate = True
- ------------------------------------------------------------------------
- File: /opt/noc/lib/collection.py (Line: 211)
- Function: update_item
- 204 # Update fields
- 205 for k in d:
- 206 setattr(o, k, d[k])
- 207 o.save()
- 208 else:
- 209 # Create item
- 210 o = self.doc(**d)
- 211 ==> o.save()
- 212 self.items[mi.uuid] = mi
- 213 self.changed = True
- 214
- 215 def lookup(self, ref, field, key):
- 216 field = str(field)
- 217 if ref not in self.ref_cache:
- Variables:
- mi =
- CollectionItem(name='pop', uuid='0f161fa9-5b69-4bbe-9efb-c6f80814305a', path='pop.json', hash='88dc37dab4ce24f03336d1b02472905f6121330a5f0014dba6e0828f59bb3a2f')
- self = <noc.lib.collection.Collection object at 0x3ad4ed0>
- data =
- {'attrs': [{'description': 'PoP level',
- 'is_const': True,
- 'name': 'level',
- 'required': True,
- 'type': 'int'}],
- 'description': 'Point of Presence',
- 'name': 'pop',
- 'uuid': '0f161fa9-5b69-4bbe-9efb-c6f80814305a'}
- d =
- {'attrs': [<ModelInterfaceAttr: level>],
- 'description': 'Point of Presence',
- 'name': 'pop',
- 'uuid': '0f161fa9-5b69-4bbe-9efb-c6f80814305a'}
- o = <ModelInterface: pop>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/collection.py (Line: 162)
- Function: apply
- 155 sr = set(collection.items)
- 156 # Delete revoked items
- 157 for i in collection.get_revoked_items():
- 158 if i in self.items:
- 159 self.delete_item(i)
- 160 # Check for new items
- 161 for i in sr - sl:
- 162 ==> self.update_item(collection.items[i])
- 163 # Update changed items
- 164 for i in sr & sl:
- 165 if self.items[i].hash != collection.items[i].hash:
- 166 self.update_item(collection.items[i])
- 167 # Update partial items
- 168 for i in self.partial:
- Variables:
- i = '0f161fa9-5b69-4bbe-9efb-c6f80814305a'
- sr =
- set(['0aef5942-e41a-4acf-ab3e-5bc406aaee08',
- '0f161fa9-5b69-4bbe-9efb-c6f80814305a',
- '15c0da42-dd46-4a3b-b420-1798c8014517',
- '18fccfab-16c0-498f-9f6c-ae034a361bcd',
- '22e46608-0ed9-4822-b80f-d833a7f05e35',
- '2a928f8d-4380-4d0a-83c4-1f00c9536484',
- '2bfdfe3a-78dc-429c-99c7-a3db73d3e491',
- '62b945a4-ebf6-4174-94a7-c77e327d16d4',
- '6aa71d8c-c4c7-4cca-91a5-3fc1af708f65',
- 'a15da7b7-98de-4843-b256-0da049137833',
- 'a3c13162-a7bf-420c-99e3-5977a5f0f47e',
- 'b20b514d-954b-4fcc-b783-19328277c289',
- 'b26d8388-0450-4c30-886d-d3d6da86c401',
- 'ba30451d-61f6-4fff-9443-f3ebfe30bbfe',
- 'c3cb0577-9ed2-4edb-b3e3-eaca6f1fed38',
- 'e8e9a35f-d051-4b11-8e0b-0d14dcbdffb1',
- 'f7a27faf-3b5d-45a6-b3f3-bedf20ea3337'])
- self = <noc.lib.collection.Collection object at 0x3ad4ed0>
- collection = <noc.lib.collection.Collection object at 0x3ad4c90>
- sl = set([])
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/collection.py (Line: 175)
- Function: handle_sync
- 168 DocCategory.fix_all()
- 169 try:
- 170 for name, doc in self.collections:
- 171 lc = Collection(name, doc, local=True)
- 172 lc.load()
- 173 dc = Collection(name, doc)
- 174 dc.load()
- 175 ==> lc.apply(dc)
- 176 except ValueError, why:
- 177 raise CommandError(why)
- 178 except DereferenceError, why:
- 179 raise CommandError(why)
- 180
- 181 def handle_upgrade(self, collections):
- Variables:
- doc = <class 'noc.inv.models.modelinterface.ModelInterface'>
- self = <noc.main.management.commands.collection.Command object at 0x38be410>
- dc = <noc.lib.collection.Collection object at 0x3ad4c90>
- name = 'inv.modelinterfaces'
- lc = <noc.lib.collection.Collection object at 0x3ad4ed0>
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/collection.py (Line: 139)
- Function: _handle
- 132 raise
- 133 except:
- 134 error_report()
- 135
- 136 def _handle(self, *args, **options):
- 137 self.verbose = bool(options.get("verbosity"))
- 138 if options["cmd"] == "sync":
- 139 ==> return self.handle_sync()
- 140 elif options["cmd"] == "upgrade":
- 141 return self.handle_upgrade(args)
- 142 elif options["cmd"] == "install":
- 143 if len(args) < 2:
- 144 parts = args[0].split(os.path.sep)
- 145 if (len(parts) < 2 or parts[1] != "collections"):
- Variables:
- self = <noc.main.management.commands.collection.Command object at 0x38be410>
- args = ()
- options =
- {'cmd': 'sync',
- 'pythonpath': None,
- 'settings': None,
- 'traceback': None,
- 'verbosity': '1'}
- ------------------------------------------------------------------------
- File: /opt/noc/main/management/commands/collection.py (Line: 130)
- Function: handle
- 123 msg = "%s\nAvailable collections:" % msg
- 124 for n, d in self.collections:
- 125 msg = "%s\n %s" % (msg, n)
- 126 return msg
- 127
- 128 def handle(self, *args, **kwargs):
- 129 try:
- 130 ==> self._handle(*args, **kwargs)
- 131 except CommandError:
- 132 raise
- 133 except:
- 134 error_report()
- 135
- 136 def _handle(self, *args, **options):
- Variables:
- self = <noc.main.management.commands.collection.Command object at 0x38be410>
- args = ()
- kwargs =
- {'cmd': 'sync',
- 'pythonpath': None,
- 'settings': None,
- 'traceback': None,
- 'verbosity': '1'}
- ------------------------------------------------------------------------
- END OF TRACEBACK
- Updating manifests
- Traceback (most recent call last):
- File "manage.py", line 35, in <module>
- import noc.urls
- File "/opt/noc/urls.py", line 18, in <module>
- site.autodiscover()
- File "/opt/noc/lib/app/site.py", line 464, in autodiscover
- {}, {}, "*")
- File "/opt/noc/inv/apps/inv/views.py", line 21, in <module>
- class InvApplication(ExtApplication):
- File "/opt/noc/lib/app/application.py", line 105, in __new__
- site.register(m)
- File "/opt/noc/lib/app/site.py", line 379, in register
- app = app_class(self)
- File "/opt/noc/inv/apps/inv/views.py", line 52, in __init__
- self.plugins[o.name] = o(self)
- File "/opt/noc/inv/apps/inv/plugins/base.py", line 18, in __init__
- self.init_plugin()
- File "/opt/noc/inv/apps/inv/plugins/conduits.py", line 61, in init_plugin
- self.conduits_model = ObjectModel.objects.get(name=self.CONDUITS_MODEL)
- File "/opt/noc/lib/python2.7/site-packages/mongoengine/queryset/base.py", line 186, in get
- raise queryset._document.DoesNotExist(msg)
- noc.inv.models.objectmodel.DoesNotExist: ObjectModel matching query does not exist.
- upgrade-user: 53: failed to update manifests
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement