From: Iustin Pop Date: Tue, 27 Jul 2010 21:07:20 +0000 (-0400) Subject: Rename masterfailover to master-failover X-Git-Tag: v2.2.0rc0~28 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/c28502b11678ab5e2abe5ab5e5bcc35352b7fb79 Rename masterfailover to master-failover Most (all?) of our commands use dash-separator: replace-disks, verify-disks, add-tags, etc. “gnt-cluster masterfailover” is an old exception to this rule. The patch replaces it with master-failover, add a compatiblity alias, and updates the documentation for this change. Signed-off-by: Iustin Pop Reviewed-by: Guido Trotter --- diff --git a/doc/admin.rst b/doc/admin.rst index c61b77f..1918dbe 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 8124d4b..d994004 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 859699b..7bd56c1 100644 --- a/man/ganeti-masterd.sgml +++ b/man/ganeti-masterd.sgml @@ -75,8 +75,8 @@ 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 gnt-cluster masterfailover - command. + cluster, via the gnt-cluster + master-failover command. diff --git a/man/ganeti.sgml b/man/ganeti.sgml index 7caad06..74d4499 100644 --- a/man/ganeti.sgml +++ b/man/ganeti.sgml @@ -110,7 +110,7 @@ The node receives the full cluster configuration (configuration file and jobs) and can become a master - via the gnt-cluster masterfailover + via the gnt-cluster master-failover command. Nodes that are not in this state cannot transition into the master role due to missing state. diff --git a/man/gnt-cluster.sgml b/man/gnt-cluster.sgml index 02abe2d..da3e547 100644 --- a/man/gnt-cluster.sgml +++ b/man/gnt-cluster.sgml @@ -564,10 +564,10 @@ - MASTERFAILOVER + MASTER-FAILOVER - masterfailover + master-failover --no-voting diff --git a/qa/qa_cluster.py b/qa/qa_cluster.py index 13e8f72..d715694 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 f5ad942..5a2b6c5 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))