Project

Profile

Help

Issue #1351

closed

The 'Branch' Mongoengine model needs to be updated.

Added by jcline@redhat.com over 8 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - OSTree:
master
Platform Release:
Target Release - OSTree:
1.1.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

https://github.com/pulp/pulp/pull/2145 altered the ContentUnit model, so the Branch model needs adjustment. Currently the initial database migration fails:

==> dev: Loading unit model: ostree = pulp_ostree.plugins.db.model:Branch
==> dev: The class Branch must define a '_content_type_id' attribute
==> dev: Applying migration pulp_rpm.plugins.migrations.0016_new_yum_distributor failed.
==> dev: 
==> dev: Halting migrations due to a migration failure.
==> dev: The ContentUnit model class Branch failed to define the attribute _content_type_id correctly
==> dev: Traceback (most recent call last):
==> dev:   File "/home/vagrant/devel/pulp/server/pulp/server/db/manage.py", line 147, in main
==> dev:     return _auto_manage_db(options)
==> dev:   File "/home/vagrant/devel/pulp/server/pulp/server/db/manage.py", line 208, in _auto_manage_db
==> dev:     migrate_database(options)
==> dev:   File "/home/vagrant/devel/pulp/server/pulp/server/db/manage.py", line 94, in migrate_database
==> dev:     update_current_version=not options.test)
==> dev:   File "/home/vagrant/devel/pulp/server/pulp/server/db/migrate/models.py", line 157, in apply_migration
==> dev:     migration.migrate()
==> dev:   File "/home/vagrant/devel/pulp_rpm/plugins/pulp_rpm/plugins/migrations/0016_new_yum_distributor.py", line 42, in migrate
==> dev:     api.initialize()
==> dev:   File "/home/vagrant/devel/pulp/server/pulp/plugins/loader/api.py", line 44, in initialize
==> dev:     _create_manager()
==> dev:   File "/home/vagrant/devel/pulp/server/pulp/plugins/loader/api.py", line 438, in _create_manager
==> dev:     _MANAGER = PluginManager()
==> dev:   File "/home/vagrant/devel/pulp/server/pulp/plugins/loader/manager.py", line 34, in __init__
==> dev:     self._load_unit_models()
==> dev:   File "/home/vagrant/devel/pulp/server/pulp/plugins/loader/manager.py", line 64, in _load_unit_models
==> dev:     model_class.validate_model_definition()
==> dev:   File "/home/vagrant/devel/pulp/server/pulp/server/db/model/__init__.py", line 527, in validate_model_definition
==> dev:     field_name='_content_type_id')
==> dev: PulpCodedException: The ContentUnit model class Branch failed to define the attribute _content_type_id correctly

The adjustment should be similar to https://github.com/pulp/pulp_puppet/pull/199

Also available in: Atom PDF