More refactor

This commit is contained in:
Roberto Alsina 2024-06-30 00:36:25 -03:00
parent 08930b9ee5
commit bd72578d9e
2 changed files with 3 additions and 6 deletions

View File

@ -125,16 +125,12 @@ module Faaso
response = docker_api.containers.create(name: container_name, config: conf) response = docker_api.containers.create(name: container_name, config: conf)
response.@warnings.each { |msg| puts "Warning: #{msg}" } response.@warnings.each { |msg| puts "Warning: #{msg}" }
docker_api.containers.start(response.@id) docker_api.containers.start(response.@id)
containers = docker_api.containers.list(
all: true,
filters: {"name" => [container_name]}
)
(1..5).each { |_| (1..5).each { |_|
break if containers[0].state == "running" break if funko.running?
sleep 0.1.seconds sleep 0.1.seconds
} }
if containers[0].state != "running" if !funko.running?
puts "Container for #{funko.name} is not running yet" puts "Container for #{funko.name} is not running yet"
next next
end end

View File

@ -1,5 +1,6 @@
require "yaml" require "yaml"
# A funko, built from its source metadata
class Funko class Funko
include YAML::Serializable include YAML::Serializable