Commit 5f83e263 authored by Iustin Pop's avatar Iustin Pop
Browse files

Change the 'gnt-cluster command' execution order

This patch makes the command execute last on the master (if the master
is selected). The order for the other nodes is unchanged.

The patch also updates the man page with some explanations and an

Reviewed-by: imsnah
parent b5401f2f
......@@ -1039,7 +1039,7 @@ class LUSetClusterParams(LogicalUnit):
"""Check prerequisites.
This checks whether the given params don't conflict and
if the given volume group is valid.
if the given volume group is valid.
if not self.op.vg_name:
......@@ -1832,6 +1832,12 @@ class LURunClusterCommand(NoHooksLU):
"""Run a command on some nodes.
# put the master at the end of the nodes list
master_node = self.sstore.GetMasterNode()
if master_node in self.nodes:
data = []
for node in self.nodes:
result = self.ssh.Run(node, "root", self.op.command)
......@@ -101,6 +101,21 @@
The command is executed serially on the selected nodes. If the
master node is present in the list, the command will be
executed last on the master. Regarding the other nodes, the
execution order is somewhat alphabetic (it's smarter so that will be earlier than but
So given the node names node1, node2, node3, node10, node11,
with node3 being the master, the order will be: node1, node2,
node10, node11, node3.
The command is constructed by concatenating all other command
line arguments. For example, to list the contents of the
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment