This patch deprecates the option --no-node-setup of 'gnt-node add'. The option is the equivalent to --no-ssh-init for 'gnt-cluster init'. However, it was rather cumbersome for users to remember whether or not the cluster was initialized with that to not forget to use this option. Instead making the user use --no-node-setup, Ganeti shall determine whether or not to change the SSH setup by reading the configuration parameter 'modify_ssh_setup' which is set with --no-ssh-init.
Signed-off-by: Helga Velroyen <[email protected]> --- lib/client/gnt_node.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py index 22e5107..4aa5c62 100644 --- a/lib/client/gnt_node.py +++ b/lib/client/gnt_node.py @@ -312,7 +312,17 @@ def AddNode(opts, args): # read the cluster name from the master (cluster_name, ) = cl.QueryConfigValues(["cluster_name"]) - if opts.node_setup: + if not opts.node_setup: + ToStdout("-- WARNING -- \n" + "The option --no-node-setup is deprecated. Whether or not the\n" + "SSH setup is manipulated while adding a node is determined\n" + "by the 'modify_ssh_setup' value in the cluster-wide\n" + "configuration instead.\n") + + (modify_ssh_setup, ) = \ + cl.QueryConfigValues(["modify_ssh_setup"]) + + if modify_ssh_setup: ToStderr("-- WARNING -- \n" "Performing this operation is going to perform the following\n" "changes to the target machine (%s) and the current cluster\n" @@ -325,7 +335,7 @@ def AddNode(opts, args): " generated public SSH key will be distributed to all other\n" " cluster nodes.\n", node) - if opts.node_setup: + if modify_ssh_setup: _SetupSSH(opts, cluster_name, node, ssh_port, cl) bootstrap.SetupNodeDaemon(opts, cluster_name, node, ssh_port) @@ -343,7 +353,7 @@ def AddNode(opts, args): master_capable=opts.master_capable, disk_state=disk_state, hv_state=hv_state, - node_setup=opts.node_setup) + node_setup=modify_ssh_setup) SubmitOpCode(op, opts=opts) -- 2.6.0.rc2.230.g3dd15c0
