lib/capistrano/asg/tasks/rolling.rake in capistrano-asg-rolling-0.4.0 vs lib/capistrano/asg/tasks/rolling.rake in capistrano-asg-rolling-0.4.1

- old
+ new

@@ -173,29 +173,29 @@ end end desc 'Get status of instance refresh' task :instance_refresh_status do - return unless config.wait_for_instance_refresh? + if config.wait_for_instance_refresh? + groups = config.autoscale_groups.to_h { |group| [group.name, group] } - groups = config.autoscale_groups.to_h { |group| [group.name, group] } - - while groups.any? - groups.each do |name, group| - refresh = group.latest_instance_refresh - if refresh.nil? || refresh.completed? - logger.info "Auto Scaling Group: **#{name}**, completed with status '#{refresh.status}'." if refresh.completed? - groups.delete(name) - elsif !refresh.percentage_complete.nil? - logger.info "Auto Scaling Group: **#{name}**, #{refresh.percentage_complete}% completed, status '#{refresh.status}'." - else - logger.info "Auto Scaling Group: **#{name}**, status '#{refresh.status}'." + while groups.any? + groups.each do |name, group| + refresh = group.latest_instance_refresh + if refresh.nil? || refresh.completed? + logger.info "Auto Scaling Group: **#{name}**, completed with status '#{refresh.status}'." if refresh.completed? + groups.delete(name) + elsif !refresh.percentage_complete.nil? + logger.info "Auto Scaling Group: **#{name}**, #{refresh.percentage_complete}% completed, status '#{refresh.status}'." + else + logger.info "Auto Scaling Group: **#{name}**, status '#{refresh.status}'." + end end - end - next if groups.empty? + next if groups.empty? - wait_for = config.instance_refresh_polling_interval - logger.info "Instance refresh(es) not completed, waiting #{wait_for} seconds..." - sleep wait_for + wait_for = config.instance_refresh_polling_interval + logger.info "Instance refresh(es) not completed, waiting #{wait_for} seconds..." + sleep wait_for + end end end end