Description of problem: ============================= Trying to import a rhevm image was failing with an stack trace (below). Turns out that I wasn't passing enough parameters which the help pointed out. Need to catch this exception and give back a better error message. # import examples from help Import examples: aeolus-image import --provider ec2-us-east-1 --target ec2 --id $ami_id # import an AMI from the specified provider aeolus-image import --provider ec2-us-east-1 --target ec2 --id $ami_id --description '<image><name>My Image</name></image>' # import an AMI from the specified provider aeolus-image import --provider ec2-us-east-1 --target ec2 --id $ami_id --description <path_to_xml_file> # import an AMI from the specified provider # here it works with the correct parms [root@intel-d3c4702-01 noarch]# aeolus-image import --id 10a1375b-a18a-4cde-aabb-15ce6759bfe8 --target rhevm --provider rhevm Target Image: f83bca5c-c3d6-40c0-a76e-78672f5ee42a Image: fa955d8f-2993-4a76-aad7-34a0ecb4f63c Build: 22fce479-aea8-4f54-bf22-433d9eb80fba Provider Image: 07210d01-5e0e-48e2-a061-7a8dcd483f1e # here it throws a stack trace with incorrect parms [root@intel-d3c4702-01 noarch]# aeolus-image import --id 10a1375b-a18a-4cde-aabb-15ce6759bfe8 --target rhevm /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.1.0/lib/aeolus_image/command/import_command.rb:45:in `import_image': undefined method `[]' for #<Qmf2::QmfAgentException:0x7f9b8e4b4b38> (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.1.0/lib/aeolus_image/command/config_parser.rb:227:in `import' from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.1.0/lib/aeolus_image/command/config_parser.rb:38:in `send' from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.1.0/lib/aeolus_image/command/config_parser.rb:38:in `process' from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.1.0/bin/aeolus-image:20 from /usr/bin/aeolus-image:19:in `load' from /usr/bin/aeolus-image:19 2011-10-20 16:21:16 warning Connection [55673 localhost:5672] closed [root@intel-d3c4702-01 noarch]#
another troubling thing in this output is that we do not use qmf anymore, so there should never be a qmf error.
tried to recreate, this is current output # aeolus-cli import --id cef85154-552e-4a2f-8f1a-a2f47d21ec0c --target rhevm ERROR: ParameterDataIncorrect => Failed. Response code = 400. Response message = Bad Request.
Should be resolved by this set of commits: commit ebd81ca158c705156fd609eacb95be1979cabc67 Author: Matt Wagner <matt.wagner> Date: Thu Dec 22 17:57:04 2011 -0500 Import command does not support :target, and :description is optional Also updates tests to match commit 7e1bd27b83ea502715b6ac840ad5f1a68de3c2a8 Author: Petr Blaho <pblaho> Date: Thu Dec 22 23:05:55 2011 +0100 Add tests for new methods in Aeolus::CLI::ImportCommand Signed-off-by: Matt Wagner <matt.wagner> commit e0173cdb9adcac8ac23b0700f2288964c63f6606 Author: Petr Blaho <pblaho> Date: Thu Dec 22 23:05:54 2011 +0100 Correct typo and delete commented out code Signed-off-by: Matt Wagner <matt.wagner> commit 5b4740f58caaf4baaa5f16d183f3ae6e5e8b2167 Author: Petr Blaho <pblaho> Date: Thu Dec 22 23:05:53 2011 +0100 Simple refactor of base_command_spec.rb Signed-off-by: Matt Wagner <matt.wagner> commit 78d61c6bf6ad951f0b5cbd92e6c31ba2b1a74d52 Author: Maros Zatko <mzatko> Date: Thu Dec 22 23:05:52 2011 +0100 change :provider to :provider_account Signed-off-by: Matt Wagner <matt.wagner> commit 21f8b1d9fc6878b7b688a3fbf1d097ecd5921547 Author: Maros Zatko <mzatko> Date: Thu Dec 22 23:05:51 2011 +0100 change :provider to :provider_account Signed-off-by: Matt Wagner <matt.wagner> commit 4999f317dd6044551eccaa764749d1400f82dfac Author: Maros Zatko <mzatko> Date: Thu Dec 22 23:05:50 2011 +0100 fix known error code condition Signed-off-by: Matt Wagner <matt.wagner> commit 604ea069fefb131f6b6498f2fd31d2735c9cb710 Author: Maros Zatko <mzatko> Date: Thu Dec 22 23:05:49 2011 +0100 bz#747719: Relax NG schema for image description xml Signed-off-by: Matt Wagner <matt.wagner> commit 50c08854d87859be230069fdfa6a71d51924867d Author: Maros Zatko <mzatko> Date: Thu Dec 22 23:05:48 2011 +0100 bz#747719: error handling for import params validations commit 87b325b1a35869088eb87b35901990dc4f861cc4 Author: Maros Zatko <mzatko> Date: Thu Dec 22 23:05:47 2011 +0100 bz#747719: validation of import parameters Signed-off-by: Matt Wagner <matt.wagner>
the commits listed in the previous comment are included in rubygem-aeolus-cli-0.3.0-2. Not sure if the component for this BZ needs to be changed to aeolus-cli, so I am leaving that alone.
Error messaging looks much better aeolus-all-0.8.0-5.el6.noarch aeolus-conductor-0.8.0-5.el6.noarch aeolus-conductor-daemons-0.8.0-5.el6.noarch aeolus-conductor-doc-0.8.0-5.el6.noarch aeolus-configure-2.5.0-3.el6.noarch rubygem-aeolus-cli-0.3.0-3.el6.noarch rubygem-aeolus-image-0.3.0-2.el6.noarch