-
- <% processes = Docker::Container.get(@container.uuid).top %>
-
- <% processes.each do |process| %>
-
-
-index' class='collapse accordion-body'>
-
<%= JSON.pretty_generate(process) %>
+ <% if @container.uuid.present? && @container.in_fog.ready? %>
+ <% if @container.in_fog.ready? %>
+
+
+
+ <% processes = Docker::Container.get(@container.uuid).top %>
+
+ <% processes.each do |process| %>
+
+
-index' class='collapse accordion-body'>
+
<%= JSON.pretty_generate(process) %>
+
+ <% end %>
- <% end %>
+
+
+
<%= Docker::Container.get(@container.uuid).logs(:stdout => true, :tail => 100) %>
-
-
<%= Docker::Container.get(@container.uuid).logs(:stdout => true, :tail => 100) %>
-
-
+ <% else %>
+
+
<%= _("Notice") %>
+
+ <%= _("Your container is stopped.") %>
+
<%= _("Please turn on your container to see processes running, logs, and more.") %>
+
+ <% end %>
<% else %>
<%= _("Notice") %>
- <%= _("Your container is stopped.") %>
-
<%= _("Please turn on your container to see processes running, logs, and more.") %>
+ <%= _("Your container is being provisioned.") %>
+
<%= _("Please wait until your image is pulled to the Docker host. You can track progress at Monitor > Tasks.") %>
<% end %>
diff --git a/foreman_docker.gemspec b/foreman_docker.gemspec
index 415f038..d98002f 100644
--- a/foreman_docker.gemspec
+++ b/foreman_docker.gemspec
@@ -20,5 +20,6 @@ Gem::Specification.new do |s|
s.add_dependency 'docker-api', '~> 1.13'
s.add_dependency 'wicked', '~> 1.1'
+ s.add_dependency 'foreman-tasks'
s.add_development_dependency 'rubocop', '~> 0.26'
end
diff --git a/lib/foreman_docker/engine.rb b/lib/foreman_docker/engine.rb
index a8380c1..d4bab90 100644
--- a/lib/foreman_docker/engine.rb
+++ b/lib/foreman_docker/engine.rb
@@ -4,6 +4,7 @@
require 'fog/fogdocker'
require 'wicked'
require 'docker'
+require 'foreman-tasks'
module ForemanDocker
# Inherit from the Rails module of the parent app (Foreman), not the plugin.
@@ -14,6 +15,10 @@ class Engine < ::Rails::Engine
config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"]
config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
+ initializer "foreman_docker.require_dynflow", :before => "foreman_tasks.initialize_dynflow" do
+ ::ForemanTasks.dynflow.require!
+ end
+
initializer 'foreman_docker.load_app_instance_data' do |app|
app.config.paths['db/migrate'] += ForemanDocker::Engine.paths['db/migrate'].existent
end
diff --git a/test/functionals/containers_steps_controller_test.rb b/test/functionals/containers_steps_controller_test.rb
index a326349..300f233 100644
--- a/test/functionals/containers_steps_controller_test.rb
+++ b/test/functionals/containers_steps_controller_test.rb
@@ -8,7 +8,8 @@ class StepsControllerTest < ActionController::TestCase
test 'wizard finishes with a redirect to the managed container' do
state = DockerContainerWizardState.create!
- Service::Containers.expects(:start_container!).with(equals(state)).returns(@container)
+ ForemanDocker::Service::Containers.expects(:start_container!)
+ .with(equals(state)).returns(@container)
put :update, { :wizard_state_id => state.id,
:id => :environment,
:docker_container_wizard_states_environment => { :tty => false } },
diff --git a/test/units/containers_service_test.rb b/test/units/containers_service_test.rb
index e2da74a..57c54c9 100644
--- a/test/units/containers_service_test.rb
+++ b/test/units/containers_service_test.rb
@@ -19,7 +19,7 @@ class ContainersServiceTest < ActiveSupport::TestCase
end
ForemanDocker::Docker.any_instance.expects(:create_container)
.returns(OpenStruct.new(:uuid => 1))
- Service::Containers.start_container!(@state)
+ ForemanDocker::Service::Containers.start_container!(@state)
assert_equal DockerContainerWizardState.where(:id => @state.id).count, 0
end
end