https://bugzilla.redhat.com/show_bug.cgi?id=714276
This patch adds nicer feedback to the user,for unimplemented list commands. --- .../image_factory/aeolus-image/lib/base_command.rb | 4 ++++ .../image_factory/aeolus-image/lib/list_command.rb | 20 ++++++++++++++++++++ .../aeolus-image/spec/list_command_spec.rb | 6 +++++- 3 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/services/image_factory/aeolus-image/lib/base_command.rb b/services/image_factory/aeolus-image/lib/base_command.rb index 8776693..3346e1a 100644 --- a/services/image_factory/aeolus-image/lib/base_command.rb +++ b/services/image_factory/aeolus-image/lib/base_command.rb @@ -15,6 +15,10 @@ module Aeolus end
protected + def not_implemented + "This option or combination is not yet implemented" + end + def logger(logger=nil) @logger ||= logger unless @logger diff --git a/services/image_factory/aeolus-image/lib/list_command.rb b/services/image_factory/aeolus-image/lib/list_command.rb index 9939f74..eb44cb1 100644 --- a/services/image_factory/aeolus-image/lib/list_command.rb +++ b/services/image_factory/aeolus-image/lib/list_command.rb @@ -9,6 +9,26 @@ module Aeolus doc = Nokogiri::XML iwhd['/images'].get doc.xpath("/objects/object/key").collect { |node| "uuid: " + node.text } end + + def builds + not_implemented + end + + def targetimages + not_implemented + end + + def targets + not_implemented + end + + def providers + not_implemented + end + + def accounts + not_implemented + end end end end diff --git a/services/image_factory/aeolus-image/spec/list_command_spec.rb b/services/image_factory/aeolus-image/spec/list_command_spec.rb index 1f47b47..9807d93 100644 --- a/services/image_factory/aeolus-image/spec/list_command_spec.rb +++ b/services/image_factory/aeolus-image/spec/list_command_spec.rb @@ -11,7 +11,11 @@ module Aeolus regexp.match(image.to_s).should_not == nil end end - + it "should return not implemented for unimplemented subcommands" do + l = ListCommand.new() + r = l.targets + r.should eql("This option or combination is not yet implemented") + end end end end \ No newline at end of file