diff --git a/doc/admin.rst b/doc/admin.rst index c61b77ff470e0769fae055e2334a645e3417cb55..1918dbe3b74a98286bca0aba5c825886c06e2953 100644 --- a/doc/admin.rst +++ b/doc/admin.rst @@ -680,7 +680,7 @@ Failing over the master node If you want to promote a different node to the master role (for whatever reason), run on any other master-candidate node the command:: - gnt-cluster masterfailover + gnt-cluster master-failover and the node you ran it on is now the new master. In case you try to run this on a non master-candidate node, you will get an error telling you diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 8124d4b2902aeb2d45bc7b274e52ea60404c18da..d994004eb8d4369a32b74cd294c5c05682bf30af 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -3965,7 +3965,7 @@ class LUSetNodeParams(LogicalUnit): # we can't change the master's node flags if self.op.node_name == self.cfg.GetMasterNode(): raise errors.OpPrereqError("The master role can be changed" - " only via masterfailover", + " only via master-failover", errors.ECODE_INVAL) diff --git a/man/ganeti-masterd.sgml b/man/ganeti-masterd.sgml index 859699b80f0bc44796c2e5aae6db94031522f519..7bd56c1ab960ee4887f623d123190b88a0977409 100644 --- a/man/ganeti-masterd.sgml +++ b/man/ganeti-masterd.sgml @@ -75,8 +75,8 @@ <para> The only action that can be done without the master daemon is the failover of the master role to another node in the - cluster, via the <command>gnt-cluster masterfailover</command> - command. + cluster, via the <command>gnt-cluster + master-failover</command> command. </para> <para> diff --git a/man/ganeti.sgml b/man/ganeti.sgml index 7caad06ef147a1b23e98bb61e4ea3250bccddb27..74d4499f8042d12c5b748560cbbeb6620d1ba697 100644 --- a/man/ganeti.sgml +++ b/man/ganeti.sgml @@ -110,7 +110,7 @@ <listitem> <para>The node receives the full cluster configuration (configuration file and jobs) and can become a master - via the <command>gnt-cluster masterfailover</command> + via the <command>gnt-cluster master-failover</command> command. Nodes that are not in this state cannot transition into the master role due to missing state.</para> diff --git a/man/gnt-cluster.sgml b/man/gnt-cluster.sgml index 02abe2d886b469be45850aaeb1a68fcfa2769a9c..da3e5473e90c9e134c3707dbb38a6adc5fa1f795 100644 --- a/man/gnt-cluster.sgml +++ b/man/gnt-cluster.sgml @@ -564,10 +564,10 @@ </refsect2> <refsect2> - <title>MASTERFAILOVER</title> + <title>MASTER-FAILOVER</title> <cmdsynopsis> - <command>masterfailover</command> + <command>master-failover</command> <arg>--no-voting</arg> </cmdsynopsis> diff --git a/qa/qa_cluster.py b/qa/qa_cluster.py index 13e8f7203445de45ad314ce10939702c5416d3b4..d715694d2dd8e0b6939caea7eb3dc403d2c4960f 100644 --- a/qa/qa_cluster.py +++ b/qa/qa_cluster.py @@ -320,16 +320,16 @@ def TestClusterBurnin(): def TestClusterMasterFailover(): - """gnt-cluster masterfailover""" + """gnt-cluster master-failover""" master = qa_config.GetMasterNode() failovermaster = qa_config.AcquireNode(exclude=master) try: - cmd = ['gnt-cluster', 'masterfailover'] + cmd = ['gnt-cluster', 'master-failover'] AssertEqual(StartSSH(failovermaster['primary'], utils.ShellQuoteArgs(cmd)).wait(), 0) - cmd = ['gnt-cluster', 'masterfailover'] + cmd = ['gnt-cluster', 'master-failover'] AssertEqual(StartSSH(master['primary'], utils.ShellQuoteArgs(cmd)).wait(), 0) finally: diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster index f5ad94210fc094a4728995f1fc792d66f01864bf..5a2b6c563fc4891154a72b8680eb0e6803b81919 100755 --- a/scripts/gnt-cluster +++ b/scripts/gnt-cluster @@ -854,7 +854,7 @@ commands = { 'repair-disk-sizes': ( RepairDiskSizes, ARGS_MANY_INSTANCES, [], "", "Updates mismatches in recorded disk sizes"), - 'masterfailover': ( + 'master-failover': ( MasterFailover, ARGS_NONE, [NOVOTING_OPT], "", "Makes the current node the master"), 'version': ( @@ -914,5 +914,12 @@ commands = { } +#: dictionary with aliases for commands +aliases = { + 'masterfailover': 'master-failover', +} + + if __name__ == '__main__': - sys.exit(GenericMain(commands, override={"tag_type": constants.TAG_CLUSTER})) + sys.exit(GenericMain(commands, override={"tag_type": constants.TAG_CLUSTER}, + aliases=aliases))