Renew-crypto: stop daemons on master node first
authorHelga Velroyen <helgav@google.com>
Wed, 21 Oct 2015 10:51:37 +0000 (12:51 +0200)
committerHelga Velroyen <helgav@google.com>
Wed, 21 Oct 2015 11:02:15 +0000 (13:02 +0200)
Otherwise, this can create problems when restarting
the nodes due to voting issues.

Signed-off-by: Gerard Oskamp <gjo@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

lib/cli.py

index 5d2fb6c..3fcfd98 100644 (file)
@@ -1535,7 +1535,9 @@ class _RunWhileDaemonsStoppedHelper(object):
       self._RunCmd(None, [pathutils.DAEMON_UTIL, "stop-master"])
       try:
         # Stop daemons on all nodes
-        for node_name in self.online_nodes:
+        online_nodes = [self.master_node] + [n for n in self.online_nodes
+                                             if n != self.master_node]
+        for node_name in online_nodes:
           self.feedback_fn("Stopping daemons on %s" % node_name)
           self._RunCmd(node_name, [pathutils.DAEMON_UTIL, "stop-all"])
           # Starting any daemons listed as exception