From 3fb3b83f4ad1254a9a54d6d81f5c58f33c92c601 Mon Sep 17 00:00:00 2001 From: "Vladimir Sharshov (warpc)" Date: Thu, 23 Mar 2017 20:33:52 +0300 Subject: [PATCH] Excluding number of nodes in stop operation notification Nailgun use block of nodes in stop operation to reset such nodes in discovery state. Also Nailgun used such data to calculate count of nodes for notifications. But Astute will not send info about nodes in case of task deployment. This patch exclude count of nodes in stop notification to prevent misslining message about successful operation for 0 nodes Change-Id: I32da2ccce11b22378f58759703fc4a56e31fd993 Closes-Bug: #1672964 --- nailgun/nailgun/rpc/receiver.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/nailgun/nailgun/rpc/receiver.py b/nailgun/nailgun/rpc/receiver.py index f4725090ca..cce9f7677b 100644 --- a/nailgun/nailgun/rpc/receiver.py +++ b/nailgun/nailgun/rpc/receiver.py @@ -722,7 +722,7 @@ class NailgunReceiver(object): ) message = cls._make_stop_deployment_message( - task, status, stop_tasks, update_nodes, message) + task, status, stop_tasks, message) notifier.notify( "done", @@ -756,7 +756,7 @@ class NailgunReceiver(object): db().flush() message = cls._make_stop_deployment_message( - task, status, stop_tasks, update_nodes, message) + task, status, stop_tasks, message) notifier.notify( "error", @@ -770,17 +770,16 @@ class NailgunReceiver(object): cls._update_action_log_entry(status, task.name, task_uuid, nodes) @classmethod - def _make_stop_deployment_message(cls, task, status, stop_tasks, nodes, - message): + def _make_stop_deployment_message(cls, task, status, stop_tasks, message): messages_by_status = { consts.TASK_STATUSES.ready: [ u"Deployment of environment '{0}' was successfully stopped. ", - u"{0} of {1} environment node(s) was successfully stopped. " + u"{0} of environment was successfully stopped. " ], consts.TASK_STATUSES.error: [ u"Deployment of environment '{0}' was failed to stop: {1}. " u"Please check logs for details.", - u"{0} of {1} environment node(s) was failed to stop: {2}. " + u"{0} of environment was failed to stop: {1}. " u"Please check logs for details." ] } @@ -792,8 +791,7 @@ class NailgunReceiver(object): process = u"Deployment" if consts.TASK_NAMES.deployment not in stop_task_names: process = u"Provisioning" - return messages_by_status[status][1].format( - process, len(nodes), message) + return messages_by_status[status][1].format(process, message) @classmethod def _restore_pending_changes(cls, nodes, task, ia_nodes):