[PATCH] bz831201 fixing handling empty array

Justin Clift jclift at redhat.com
Fri Jul 13 14:10:16 UTC 2012


On 13/07/2012, at 11:01 PM, Dan Radez wrote:
> ---
> src/app/models/deployable.rb |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/app/models/deployable.rb b/src/app/models/deployable.rb
> index 9c6aff9..e1d80d5 100644
> --- a/src/app/models/deployable.rb
> +++ b/src/app/models/deployable.rb
> @@ -252,7 +252,7 @@ class Deployable < ActiveRecord::Base
>     icicle_uuid = image.latest_pushed_or_unpushed_build.target_images.first.icicle rescue nil
>     icicle = Aeolus::Image::Warehouse::Icicle.find(icicle_uuid) if icicle_uuid
>     agent_v = icicle ? icicle.packages.find_all { |p| p =~ /aeolus-audrey-agent(.*)/ } : ""
> -    agent_v = agent_v.first.split('-')[3] if agent_v.present?
> +    agent_v = agent_v.present? ? agent_v.first.split('-')[3] : ""
> 
>     # calculate audrey api version
>     audrey_api_v = if agent_v >= "0.5.0"
> -- 
> 1.7.10.4

Tested it here against master.  Fixes the problem here.

+ Justin

--
Aeolus Community Manager
http://www.aeolusproject.org




More information about the aeolus-devel mailing list