Revert "Support global progress for tasks"

This reverts commit 3f21d35f35.

Change-Id: If0cf99129fdc38c40ee8322c872f6b4f9b83c0b5
Partial-bug: #1633212
This commit is contained in:
Vladimir Kuklin 2016-10-13 23:37:10 +03:00
parent bca595a964
commit 1ab30505b7
2 changed files with 7 additions and 29 deletions

View File

@ -72,7 +72,7 @@ module Astute
) if task.failed? ) if task.failed?
end end
@ctx.report('nodes' => [node_status], 'progress' => cluster_progress) @ctx.report('nodes' => [node_status])
end end
private private
@ -106,14 +106,6 @@ module Astute
end end
end end
def cluster_progress
if cluster.tasks_total_count != 0
100 * cluster.tasks_finished_count / cluster.tasks_total_count
else
100
end
end
def select_task_engine(data) def select_task_engine(data)
noop_prefix = noop_run? && not_noop_type?(data) ? "Noop" : "" noop_prefix = noop_run? && not_noop_type?(data) ? "Noop" : ""
task_class_name = noop_prefix + data['type'].split('_').collect(&:capitalize).join task_class_name = noop_prefix + data['type'].split('_').collect(&:capitalize).join

View File

@ -100,8 +100,7 @@ describe Astute::TaskNode do
'deployment_graph_task_name' => 'openstack-haproxy-mysqld', 'deployment_graph_task_name' => 'openstack-haproxy-mysqld',
'task_status' => 'running', 'task_status' => 'running',
'summary' => {} 'summary' => {}
}], }])
'progress' => 0)
task_node.run(task) task_node.run(task)
end end
@ -328,8 +327,7 @@ describe Astute::TaskNode do
'deployment_graph_task_name' => task.name, 'deployment_graph_task_name' => task.name,
'summary' => {}, 'summary' => {},
'task_status' => 'successful', 'task_status' => 'successful',
'progress' => 100}], 'progress' => 100}]
'progress' => 100
}) })
task_node.poll task_node.poll
end end
@ -358,8 +356,7 @@ describe Astute::TaskNode do
'status' => 'ready', 'status' => 'ready',
'summary' => {}, 'summary' => {},
'task_status' => 'skipped', 'task_status' => 'skipped',
'progress' => 100}], 'progress' => 100}]
'progress' => 100
}) })
task_node.poll task_node.poll
end end
@ -377,8 +374,7 @@ describe Astute::TaskNode do
'deployment_graph_task_name' => task.name, 'deployment_graph_task_name' => task.name,
'summary' => {}, 'summary' => {},
'task_status' => 'skipped', 'task_status' => 'skipped',
'progress' => 50}], 'progress' => 50}]
'progress' => 50
}) })
task_node.poll task_node.poll
end end
@ -392,14 +388,6 @@ describe Astute::TaskNode do
Astute::Puppet.any_instance.expects(:status).returns(:failed) Astute::Puppet.any_instance.expects(:status).returns(:failed)
ctx.expects(:report).with(
'nodes' => [{
'uid' => 'node_id',
'progress' => 0,
'deployment_graph_task_name' => 'test-task',
'task_status' => 'running',
'summary' => {}}],
'progress' => 0)
task_node.run(task) task_node.run(task)
ctx.expects(:report).with({ ctx.expects(:report).with({
'nodes' => [{ 'nodes' => [{
@ -410,8 +398,7 @@ describe Astute::TaskNode do
'task_status' => 'failed', 'task_status' => 'failed',
'error_type' => 'deploy', 'error_type' => 'deploy',
'error_msg' => "Task #{task.name} failed on node node_id", 'error_msg' => "Task #{task.name} failed on node node_id",
'progress' => 100}], 'progress' => 100}]
'progress' => 100
}) })
task_node.poll task_node.poll
end end
@ -429,8 +416,7 @@ describe Astute::TaskNode do
'deployment_graph_task_name' => task.name, 'deployment_graph_task_name' => task.name,
'summary' => {}, 'summary' => {},
'task_status' => 'successful', 'task_status' => 'successful',
'progress' => 50}], 'progress' => 50}]
'progress' => 50
}) })
task_node.poll task_node.poll
end end