[PATCH conductor] BZ 784557 - send build request only if there are some providers

Jan Provaznik jprovazn at redhat.com
Mon Feb 6 15:52:06 UTC 2012


On 02/06/2012 02:51 PM, Tomas Sedovic wrote:
> On 02/01/2012 02:50 PM, jprovazn at redhat.com wrote:
>> From: Jan Provaznik<jprovazn at redhat.com>
>>
>> ---
>> src/app/controllers/images_controller.rb | 11 +++++++----
>> src/config/locales/en.yml | 1 +
>> 2 files changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/app/controllers/images_controller.rb
>> b/src/app/controllers/images_controller.rb
>> index 41c48a5..4821d7e 100644
>> --- a/src/app/controllers/images_controller.rb
>> +++ b/src/app/controllers/images_controller.rb
>> @@ -64,10 +64,13 @@ class ImagesController< ApplicationController
>>
>> def rebuild_all
>> @image = Aeolus::Image::Warehouse::Image.find(params[:id])
>> - factory_image = Aeolus::Image::Factory::Image.new(:id => @image.id)
>> - factory_image.targets = Provider.list_for_user(current_user,
>> Privilege::VIEW).map {|p|
>> p.provider_type.deltacloud_driver}.uniq.join(',')
>> - factory_image.template = @image.template_xml.to_s
>> - factory_image.save!
>> + targets = Provider.list_for_user(current_user, Privilege::VIEW).map
>> {|p| p.provider_type.deltacloud_driver}.uniq
>> + unless targets.empty?
>> + factory_image = Aeolus::Image::Factory::Image.new(:id => @image.id)
>> + factory_image.targets = targets.join(',')
>> + factory_image.template = @image.template_xml.to_s
>> + factory_image.save!
>> + end
>> redirect_to image_path(@image.id)
>> end
>>
>> diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
>> index 0467072..7e8e53d 100644
>> --- a/src/config/locales/en.yml
>> +++ b/src/config/locales/en.yml
>> @@ -762,6 +762,7 @@ en:
>> no_file: You must specify the template XML file
>> no_template: "The image doesn't have a template because it's been
>> imported."
>> no_provider_accounts: Images cannot be built, as no provider accounts
>> are currently enabled.
>> + no_providers: Images cannot be built and pushed, as no providers are
>> currently enabled.
>
> I grep'd through Conductor's sources but couldn't find the
> `no_providers` locale key used anywhere. Is this going to be used by
> some other patch that hasn't been pushed yet?
>

This is forgotten line which shouldn't be here.

>> new:
>> new_image: New Image
>> description:
>
> ACK with a nit inline.

Pushed w/ the locale string removed. Thanks for the review.

Jan



More information about the aeolus-devel mailing list