On 07/21/2011 11:37 AM, Tomas Sedovic wrote:
On 07/21/2011 05:27 PM, mtaylor(a)redhat.com wrote:
> From: Martyn Taylor<mtaylor(a)redhat.com>
>
> ---
> lib/list_command.rb | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/lib/list_command.rb b/lib/list_command.rb
> index 52f112b..ac0bc17 100644
> --- a/lib/list_command.rb
> +++ b/lib/list_command.rb
> @@ -6,6 +6,7 @@ module Aeolus
> end
>
> def images
> + check_bucket_exists("images")
> images = [["IMAGE ID", "LASTEST PUSHED BUILD",
"NAME", "TARGET", "OS", "OS VERSION",
"ARCH", "DESCRIPTION"]]
> doc = Nokogiri::XML iwhd['/target_images'].get
> # Check for any invalid data in iwhd
> @@ -34,6 +35,7 @@ module Aeolus
> end
>
> def builds
> + check_bucket_exists("builds")
> doc = Nokogiri::XML iwhd['/builds'].get
> doc.xpath("/objects/object/key").each do |build|
> if iwhd['/builds/' + build.text + "/image"].get ==
@options[:id]
> @@ -44,6 +46,7 @@ module Aeolus
> end
>
> def targetimages
> + check_bucket_exists("target-images")
> doc = Nokogiri::XML iwhd['/target_images'].get
> doc.xpath("/objects/object/key").each do |target_image|
> begin
> @@ -136,6 +139,14 @@ module Aeolus
> ""
> end
> end
> +
> + def check_bucket_exists(bucket)
> + begin
> + iwhd["/" + bucket].get
> + rescue
> + quit(0)
> + end
> + end
> end
> end
> end
ACK, works for me.
Thomas
It looks like this was pushed to master only. I talked with Steve and
he confirmed that he had a conversation with Martyn confirming that this
should indeed land in the maintenance branch so I cherry-picked this commit.
Thanks,
Mike