summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Sharshov (warpc) <vsharshov@mirantis.com>2017-03-23 20:33:52 +0300
committerVladimir Sharshov <vsharshov@mirantis.com>2017-03-28 15:51:45 +0000
commit3fb3b83f4ad1254a9a54d6d81f5c58f33c92c601 (patch)
tree257ba895d883c8c981162cc82592f0c13d6c8a6d
parent531e275d348a602fdee6797d0adbddd9ed4f1cd2 (diff)
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
Notes
Notes (review): Verified+1: Fuel CI <fuel-ci-bot@mirantis.com> Code-Review+2: Alexander Kislitsky <akislitsky@mirantis.com> Code-Review+1: Georgy Kibardin <gkibardin@mirantis.com> Code-Review+2: Bulat Gaifullin <gaifullinbf@gmail.com> Workflow+1: Bulat Gaifullin <gaifullinbf@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 26 Apr 2017 13:23:38 +0000 Reviewed-on: https://review.openstack.org/449247 Project: openstack/fuel-web Branch: refs/heads/master
-rw-r--r--nailgun/nailgun/rpc/receiver.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/nailgun/nailgun/rpc/receiver.py b/nailgun/nailgun/rpc/receiver.py
index f472509..cce9f76 100644
--- a/nailgun/nailgun/rpc/receiver.py
+++ b/nailgun/nailgun/rpc/receiver.py
@@ -722,7 +722,7 @@ class NailgunReceiver(object):
722 ) 722 )
723 723
724 message = cls._make_stop_deployment_message( 724 message = cls._make_stop_deployment_message(
725 task, status, stop_tasks, update_nodes, message) 725 task, status, stop_tasks, message)
726 726
727 notifier.notify( 727 notifier.notify(
728 "done", 728 "done",
@@ -756,7 +756,7 @@ class NailgunReceiver(object):
756 756
757 db().flush() 757 db().flush()
758 message = cls._make_stop_deployment_message( 758 message = cls._make_stop_deployment_message(
759 task, status, stop_tasks, update_nodes, message) 759 task, status, stop_tasks, message)
760 760
761 notifier.notify( 761 notifier.notify(
762 "error", 762 "error",
@@ -770,17 +770,16 @@ class NailgunReceiver(object):
770 cls._update_action_log_entry(status, task.name, task_uuid, nodes) 770 cls._update_action_log_entry(status, task.name, task_uuid, nodes)
771 771
772 @classmethod 772 @classmethod
773 def _make_stop_deployment_message(cls, task, status, stop_tasks, nodes, 773 def _make_stop_deployment_message(cls, task, status, stop_tasks, message):
774 message):
775 messages_by_status = { 774 messages_by_status = {
776 consts.TASK_STATUSES.ready: [ 775 consts.TASK_STATUSES.ready: [
777 u"Deployment of environment '{0}' was successfully stopped. ", 776 u"Deployment of environment '{0}' was successfully stopped. ",
778 u"{0} of {1} environment node(s) was successfully stopped. " 777 u"{0} of environment was successfully stopped. "
779 ], 778 ],
780 consts.TASK_STATUSES.error: [ 779 consts.TASK_STATUSES.error: [
781 u"Deployment of environment '{0}' was failed to stop: {1}. " 780 u"Deployment of environment '{0}' was failed to stop: {1}. "
782 u"Please check logs for details.", 781 u"Please check logs for details.",
783 u"{0} of {1} environment node(s) was failed to stop: {2}. " 782 u"{0} of environment was failed to stop: {1}. "
784 u"Please check logs for details." 783 u"Please check logs for details."
785 ] 784 ]
786 } 785 }
@@ -792,8 +791,7 @@ class NailgunReceiver(object):
792 process = u"Deployment" 791 process = u"Deployment"
793 if consts.TASK_NAMES.deployment not in stop_task_names: 792 if consts.TASK_NAMES.deployment not in stop_task_names:
794 process = u"Provisioning" 793 process = u"Provisioning"
795 return messages_by_status[status][1].format( 794 return messages_by_status[status][1].format(process, message)
796 process, len(nodes), message)
797 795
798 @classmethod 796 @classmethod
799 def _restore_pending_changes(cls, nodes, task, ia_nodes): 797 def _restore_pending_changes(cls, nodes, task, ia_nodes):