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

Actions #1

Updated by ipanova@redhat.com over 8 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ipanova@redhat.com
Actions #2

Updated by ipanova@redhat.com over 8 years ago

  • Status changed from ASSIGNED to POST
  • Version - OSTree set to master
  • Target Release - OSTree set to master
Actions #3

Updated by mhrivnak over 8 years ago

  • Triaged changed from No to Yes

Added by ipanova@redhat.com over 8 years ago

Revision 25b18311 | View on GitHub

Updates plugin to match platform changes on ContentUnit

closes#1351

  • renames unit_type_id to _content_type_id
  • updates tests so they pass too
Actions #4

Updated by ipanova@redhat.com over 8 years ago

  • Status changed from POST to MODIFIED
Actions #5

Updated by Ichimonji10 about 8 years ago

Irrelevant gibberish. See helpful comments by ipanova below.

Actions #6

Updated by ipanova@redhat.com about 8 years ago

Jeremy, This issue was submitted and fixed against master branch. You rolled back the platform to 2.7dev but your ostree plugin still points to master. you need to checkout the branch to 1.0dev

[ipanova@ina pulp_ostree]$ git checkout master 
Switched to branch 'master'
Your branch is up-to-date with 'upstream/master'.
[ipanova@ina pulp_ostree]$ git grep SharedContentUnit
plugins/pulp_ostree/plugins/db/model.py:from pulp.server.db.model import SharedContentUnit
plugins/pulp_ostree/plugins/db/model.py:class Branch(SharedContentUnit):
plugins/pulp_ostree/plugins/db/model.py:        :type document: SharedContentUnit
plugins/test/unit/plugins/db/test_model.py:        with patch('pulp.server.db.model.SharedContentUnit.pre_save_signal') as base:
[ipanova@ina pulp_ostree]$ git checkout 1.0-dev 
Switched to branch '1.0-dev'
Your branch is up-to-date with 'upstream/1.0-dev'.
[ipanova@ina pulp_ostree]$ git grep SharedContentUnit
[ipanova@ina pulp_ostree]$ 

Also check explicitly here what version of pulp-ostree plugin pulp2.7 uses https://repos.fedorapeople.org/repos/pulp/pulp/testing/automation/2.7/dev/fedora-23/x86_64/ ( which was build from 1.0dev branch )
And here the pulp2.8 uses pulp-ostree-plugins-1.1.0-0.5.beta.git.1.44a7bbe.fc23.noarch.rpm which points currently to master https://repos.fedorapeople.org/repos/pulp/pulp/testing/automation/2.8/dev/fedora-23/x86_64/

Actions #7

Updated by Ichimonji10 about 8 years ago

Jeremy, This issue was submitted and fixed against master branch. You rolled back the platform to 2.7dev but your ostree plugin still points to master. you need to checkout the branch to 1.0dev

OK. I'll check out the 1.0dev branch as part of the rollback process.

Also check explicitly here what version of pulp-ostree plugin pulp2.7 uses [...]

I see that all three of the ostree packages (python-pulp-ostree-common, pulp-ostree-admin-extensions and pulp-ostree-plugins) have an identical version number. Is this always the case, or might they ever differ? Assuming they may differ, should I always refer to the pulp-ostree-plugins package when determining the canonical version of ostree present in a Pulp release?

Actions #8

Updated by ipanova@redhat.com about 8 years ago

Should have same version number.

Actions #9

Updated by Ichimonji10 about 8 years ago

Should have same version number.

OK. Thank you.

Jeremy, This issue was submitted and fixed against master branch. You rolled back the platform to 2.7dev but your ostree plugin still points to master. you need to checkout the branch to 1.0dev

OK. I'll check out the 1.0dev branch as part of the rollback process.

Thanks for this advice. It's allowed me to more intelligently install the appropriate plugin versions:

#!/bin/bash
# Downgrade a Pulp system from master to 2.7.
#
# WARNING: This script enabled and disables system-wide yum/dnf repositories and
# performs other system-wide actions. Execute with care.
set -euo pipefail

# This associative array is incomplete. Patches welcome.
declare -rA repos_branches=(
    [pulp]=2.7-dev
    [pulp_ostree]=1.0-dev
    [pulp_puppet]=2.7-dev
    [pulp_python]=1.0-dev
    [pulp_rpm]=2.7-dev
)

# Reinstall plugins we know how to handle, and uninstall all others.
pushd ~/devel
for repo in pulp*; do
    # Defend against e.g. a file named "pulp_log.txt".
    if [ ! -d "$repo" ]; then
        continue
    fi

    pushd "$repo"
    if [ -n "${repos_branches[$repo]:-}" ]; then
        git checkout "${repos_branches[$repo]}"
        find . -name '*.py[c0]' -delete
        sudo ./pulp-dev.py --install
    else
        sudo ./pulp-dev.py --uninstall
    fi
    popd
done
popd

# further code omitted
Actions #10

Updated by rbarlow about 8 years ago

  • Status changed from MODIFIED to 5
  • Target Release - OSTree changed from master to 1.1.0
Actions #11

Updated by semyers almost 8 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #12

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF