[PATCH conductor] BZ 788114 - Un-protects populate_realms method

Scott Seago sseago at redhat.com
Tue Feb 7 20:33:24 UTC 2012


On 02/07/2012 03:25 PM, Matt Wagner wrote:
> An apparent merge conflict made the populate_realms method a protected
> method. This method should not be protected.
>
> Fixes https://bugzilla.redhat.com/show_bug.cgi?id=788114
> ---
>   src/app/models/provider.rb |   48 ++++++++++++++++++++++----------------------
>   1 files changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/src/app/models/provider.rb b/src/app/models/provider.rb
> index 716c65f..1cbd99f 100644
> --- a/src/app/models/provider.rb
> +++ b/src/app/models/provider.rb
> @@ -131,30 +131,6 @@ class Provider<  ActiveRecord::Base
>       valid_framework? ? [] : stoppable_instances
>     end
>
> -  protected
> -
> -  def stop_instances(user)
> -    errs = []
> -    stoppable_instances.each do |instance|
> -      begin
> -        unless instance.valid_action?('stop')
> -          raise "stop is an invalid action."
> -        end
> -
> -        unless @task = instance.queue_action(user, 'stop')
> -          raise "stop cannot be performed on this instance."
> -        end
> -        Taskomatic.stop_instance(@task)
> -      rescue Exception =>  e
> -        err = "Error while stopping an instance #{instance.name}: #{e.message}"
> -        errs<<  err
> -        logger.error err
> -        logger.error e.backtrace.join("\n  ")
> -      end
> -    end
> -    errs
> -  end
> -
>     def populate_realms
>       reload
>
> @@ -231,6 +207,30 @@ class Provider<  ActiveRecord::Base
>
>     end
>
> +  protected
> +
> +  def stop_instances(user)
> +    errs = []
> +    stoppable_instances.each do |instance|
> +      begin
> +        unless instance.valid_action?('stop')
> +          raise "stop is an invalid action."
> +        end
> +
> +        unless @task = instance.queue_action(user, 'stop')
> +          raise "stop cannot be performed on this instance."
> +        end
> +        Taskomatic.stop_instance(@task)
> +      rescue Exception =>  e
> +        err = "Error while stopping an instance #{instance.name}: #{e.message}"
> +        errs<<  err
> +        logger.error err
> +        logger.error e.backtrace.join("\n  ")
> +      end
> +    end
> +    errs
> +  end
> +
>     def stoppable_instances
>       provider_accounts.inject([]) {|all, pa| all += pa.instances.stopable}
>     end
ACK,

Works for me -- the only change here moves the protected method lower in 
the file, and the content of the method is unchanged.

Scott




More information about the aeolus-devel mailing list