[Pulp-list] pulp-migrate failed

Jay Dobies jason.dobies at redhat.com
Mon Feb 28 15:25:28 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/28/2011 10:10 AM, Jason L Connor wrote:
> 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.

I don't have any solid ideas, but this was on a new DB. Some coverage is
probably better than none at all.

> 
> 
> 
> _______________________________________________
> Pulp-list mailing list
> Pulp-list at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-list


- -- 
Jay Dobies
RHCE# 805008743336126
Freenode: jdob
http://pulpproject.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNa75oAAoJEOMmcTqOSQHCW48IAJe9ux6pVB+FY59/RzpFlbaz
OnreRSlYdsoW/NqXZJgDcTbb9TEaaOaWAN546tMOLNtUuChbL8bUYvmaz9YVAyQA
byTcD1i6wQkVKq1ZirOi+pQ3qLmpqz0e1VoEBbHRbRCjXB1BaZc+a8x4ENXvtJ/6
9j4GeYYKjr7dNUFddZ4Zglqt32CywMgffVWk5fUOLQ1BXrT8i3A1akQz46wu5NEl
cDY/Js3c5vXyIKgyZ6FjAgycRIkjIJM83YCaL/6N2bR6/L4cyvPAkMCjjW/8epAA
9aOV9zfk2xQhwdGpSRwYa9NR6+ram/fz3m2499XAyzx7k4EN+4UjHKATemwIVzk=
=jtHT
-----END PGP SIGNATURE-----




More information about the Pulp-list mailing list