diff --git a/lib/astute/task_node.rb b/lib/astute/task_node.rb index 8ee2ba02..8f6d0771 100644 --- a/lib/astute/task_node.rb +++ b/lib/astute/task_node.rb @@ -72,7 +72,7 @@ module Astute ) if task.failed? end - @ctx.report('nodes' => [node_status], 'progress' => cluster_progress) + @ctx.report('nodes' => [node_status]) end private @@ -106,14 +106,6 @@ module Astute 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) noop_prefix = noop_run? && not_noop_type?(data) ? "Noop" : "" task_class_name = noop_prefix + data['type'].split('_').collect(&:capitalize).join diff --git a/spec/unit/task_node_spec.rb b/spec/unit/task_node_spec.rb index 4e513a37..33ed297c 100644 --- a/spec/unit/task_node_spec.rb +++ b/spec/unit/task_node_spec.rb @@ -100,8 +100,7 @@ describe Astute::TaskNode do 'deployment_graph_task_name' => 'openstack-haproxy-mysqld', 'task_status' => 'running', 'summary' => {} - }], - 'progress' => 0) + }]) task_node.run(task) end @@ -328,8 +327,7 @@ describe Astute::TaskNode do 'deployment_graph_task_name' => task.name, 'summary' => {}, 'task_status' => 'successful', - 'progress' => 100}], - 'progress' => 100 + 'progress' => 100}] }) task_node.poll end @@ -358,8 +356,7 @@ describe Astute::TaskNode do 'status' => 'ready', 'summary' => {}, 'task_status' => 'skipped', - 'progress' => 100}], - 'progress' => 100 + 'progress' => 100}] }) task_node.poll end @@ -377,8 +374,7 @@ describe Astute::TaskNode do 'deployment_graph_task_name' => task.name, 'summary' => {}, 'task_status' => 'skipped', - 'progress' => 50}], - 'progress' => 50 + 'progress' => 50}] }) task_node.poll end @@ -392,14 +388,6 @@ describe Astute::TaskNode do 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) ctx.expects(:report).with({ 'nodes' => [{ @@ -410,8 +398,7 @@ describe Astute::TaskNode do 'task_status' => 'failed', 'error_type' => 'deploy', 'error_msg' => "Task #{task.name} failed on node node_id", - 'progress' => 100}], - 'progress' => 100 + 'progress' => 100}] }) task_node.poll end @@ -429,8 +416,7 @@ describe Astute::TaskNode do 'deployment_graph_task_name' => task.name, 'summary' => {}, 'task_status' => 'successful', - 'progress' => 50}], - 'progress' => 50 + 'progress' => 50}] }) task_node.poll end