[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Pulp-list] pulp-migrate failed



On Mon, 2011-02-28 at 08:40 -0500, Jay Dobies wrote:
> I tried running migrate on a new DB from master today and it failed,
> showing this in the logs:
> 
> migration to data model version 1 starting
> migration to data model version 1 complete
> migration to data model version 1 started
> migration to data model version 1 complete
> migration to data model version 2 started
> RepoApi instance has no attribute '_getcollection'
> Traceback (most recent call last):
>   File "/home/jdob/code/pulp/src/pulp/server/db/migrate/script.py",
> line
> 87, in datamodel_migration
>     mod.migrate()
>   File
> "/home/jdob/code/pulp/src/pulp/server/db/migrate/versions/two.py",
> line
> 108, in migrate
>     _migrate_repo_model()
>   File
> "/home/jdob/code/pulp/src/pulp/server/db/migrate/versions/two.py",
> line
> 63, in _migrate_repo_model
>     collection = RepoApi()._getcollection()
> AttributeError: RepoApi instance has no attribute '_getcollection'
> 
> migration to data model version 2 failed
> 
> 
> Is this just because we changed the model/collection handling and
> didn't
> update the migrate scripts? Is there a way we can have unit tests
> check
> migrate so we get notified if any APIs used by migrate in the future
> change? It'll probably be rare, but still a possibility that things
> used
> by migrate will change. 

When I switched over to the new Model.get_collection(), I left the
existing PulpApi._getcollection() in place (just passing through to the
previous call) for just this reason. If you want to remove an api call,
I recommend using your ide's refactoring tools to rename it first, this
will give you all of the locations that it's called.

That said, the db migration stuff is notoriously hard to test because a
new db will always pass. Ideas are welcome here.

-- 
Jason L Connor
linear on freenode #pulp
http://pulpproject.org/
RHCE: 805010912355231
GPG Fingerprint: 2048R/CC4ED7C1

Attachment: signature.asc
Description: This is a digitally signed message part


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]