On Wed, Jan 04, 2012 at 03:37:07PM +0100, ifarkas(a)redhat.com wrote:
That bug is nearly identical to this one that I recently addressed:
https://bugzilla.redhat.com/show_bug.cgi?id=765703
---
src/app/controllers/images_controller.rb | 6 ++++++
src/config/locales/en.yml | 3 +++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/app/controllers/images_controller.rb
b/src/app/controllers/images_controller.rb
index 018929c..f5a0791 100644
--- a/src/app/controllers/images_controller.rb
+++ b/src/app/controllers/images_controller.rb
@@ -92,6 +92,12 @@ class ImagesController < ApplicationController
end
def import
+ if params[:image_id].blank? || params[:name].blank?
+ flash[:warning] = t('images.import.flash.warning.name_or_image_id_blank')
+ redirect_to new_image_url(:tab => 'import')
+ return
+ end
+
I had intended for image name to be allowed to be left blank, actually.
If it's blank, we default to the AMI ID (e.g., "ami-abc123") -- or the
name on the cloud provider where it's present and read via Deltacloud.
As for blank image ID, I recently fixed this in #765703 (linked above).
-- Matt