On Tue, 2011-04-19 at 16:47 +0200, tsedovic@redhat.com wrote:
From: Tomas Sedovic tsedovic@redhat.com
This fixes Redmine #692
We're building the credentials XML that's passed to Image Factory dynamically using the credential_definitions table now.
The advantage is that as we add new providers, we won't have to update the build_credentials function. We populate the credential_definitions with the new entries and that will be it.
Fix according to jay's suggestions
Ok, the xml generation part of this patch is now perfect. I do have a couple minor problems with the migration though.
* There should also be an update to seeds.rb, so an initial run of this works w/o the migration. * The migration should conditionally run depending on if data is there, as we have done in other migrations of late. * The migration did not seem to work correctly on my database with existing providers. When I did a db:migrate, then checked the console for what xml was generated with build_credentials, I still got the old values, so instead of 'access_key', the xml generated 'username'. When I dropped the db and ran the migrations from scratch, it seemed to work as expected.
Lastly, I talked to Ian on the factory team (and scott on conductor side), and I think the easiest solution to the 'key' and 'credential' names being unintelligible to a user is to change the value in our db, and have factory look for that new name in the xml as well. The net of this is, leave the confusing name for now, in the next sprint we will have the new xml expected on factory side, and we will have a task to update the value (so the patch will be basically a migration).
So, hate to say it, but I think this will need one more rev to get the migration/seed bit right, but it is really just about there.
-j