return 0
+def RedistributeConfig(opts, args):
+ """Forces push of the cluster configuration.
+
+ @param opts: the command line options selected by the user
+ @type args: list
+ @param args: empty list
+ @rtype: int
+ @return: the desired exit code
+
+ """
+ op = opcodes.OpRedistributeConf()
+ SubmitOrSend(op, opts)
+ return 0
+
+
def ShowClusterVersion(opts, args):
"""Write version of ganeti software to the standard output.
cluster_name = cl.QueryConfigValues(["cluster_name"])[0]
- op = opcodes.OpQueryNodes(output_fields=["name"], names=opts.nodes)
- results = [row[0] for row in SubmitOpCode(op, cl=cl) if row[0] != myname]
+ results = GetOnlineNodes(nodes=opts.nodes, cl=cl)
+ results = [name for name in results if name != myname]
srun = ssh.SshRunner(cluster_name=cluster_name)
for node in results:
cl = GetClient()
command = " ".join(args)
- op = opcodes.OpQueryNodes(output_fields=["name"], names=opts.nodes)
- nodes = [row[0] for row in SubmitOpCode(op, cl=cl)]
+
+ nodes = GetOnlineNodes(nodes=opts.nodes, cl=cl)
cluster_name, master_node = cl.QueryConfigValues(["cluster_name",
"master_node"])
'rename': (RenameCluster, ARGS_ONE, [DEBUG_OPT, FORCE_OPT],
"<new_name>",
"Renames the cluster"),
+ 'redist-conf': (RedistributeConfig, ARGS_NONE, [DEBUG_OPT, SUBMIT_OPT],
+ "",
+ "Forces a push of the configuration file and ssconf files"
+ " to the nodes in the cluster"),
'verify': (VerifyCluster, ARGS_NONE, [DEBUG_OPT,
make_option("--no-nplus1-mem", dest="skip_nplusone_mem",
help="Skip N+1 memory redundancy tests",