lib/percheron/stack.rb in percheron-0.6.3 vs lib/percheron/stack.rb in percheron-0.6.4
- old
+ new
@@ -44,12 +44,11 @@
exec_on_dependant_containers_for(container_names) { |container| Actions::Stop.new(container).execute! }
end
def start!(container_names: [])
container_names = dependant_containers_for(container_names)
- exec_on_dependant_containers_for(container_names) { |container| Actions::Start.new(container, container.dependant_containers.values).execute! }
-
+ exec_on_dependant_containers_for(container_names) { |container| Actions::Start.new(container, dependant_containers: container.dependant_containers.values).execute! }
end
def restart!(container_names: [])
container_names = dependant_containers_for(container_names)
exec_on_dependant_containers_for(container_names) { |container| Actions::Restart.new(container).execute! }
@@ -71,15 +70,13 @@
end
exec_on_dependant_containers_for(container_names_final.uniq) { |container| Actions::Recreate.new(container, force_recreate: force_recreate, delete: delete).execute! }
end
- def purge!
- serial_processor(filter_container_names) do |container|
- Actions::Purge.new(container).execute!
- $logger.info ''
- end
+ def purge!(container_names: [])
+ container_names = filter_container_names(container_names)
+ exec_on_dependant_containers_for(container_names) { |container| Actions::Purge.new(container).execute! }
end
def valid?
Validators::Stack.new(self).valid?
end
@@ -104,11 +101,10 @@
filter_containers(container_names).each { |_, container| yield(container) }
end
def exec_on_dependant_containers_for(container_names)
serial_processor(container_names) do |container|
- yield(container)
- $logger.info ''
+ $logger.info '' if yield(container)
end
end
def serial_processor(container_names)
exec_on_containers(container_names) do |container|