Skip to content

Commit f016a26

Browse files
authored
Dev: Hide 'configure ms' command (jsc#PED-8550) (#1450)
Changes include: - Hide 'configure ms' command from UI; crmsh still supports to interpret the old syntax, but not recommend to use it - Move 'id-ref' usage into help primitive section - Drop help info of 'configure ms' command
2 parents 49d57d5 + e88c235 commit f016a26

File tree

3 files changed

+31
-58
lines changed

3 files changed

+31
-58
lines changed

crmsh/command.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from . import help as help_module
1212
from . import ui_utils
1313
from . import log
14+
from . import constants
1415

1516

1617
logger = log.setup_logger(__name__)
@@ -423,7 +424,9 @@ def get_completions(self):
423424
'''
424425
return tab completions
425426
'''
426-
return [x for x in self._children.keys() if x not in self._aliases]
427+
return [x for x in self._children.keys() if
428+
x not in self._aliases and
429+
x not in constants.HIDDEN_COMMANDS]
427430

428431
def get_child(self, child):
429432
'''

crmsh/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,4 +525,7 @@
525525
CSYNC2_PORT = 30865
526526
HAWK_PORT = 7630
527527
DLM_PORT = 21064
528+
529+
# Commands that are deprecated and hidden from UI
530+
HIDDEN_COMMANDS = {'ms'}
528531
# vim:ts=4:sw=4:et:

doc/crm.8.adoc

Lines changed: 24 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,7 +2531,6 @@ Commands for resources are:
25312531
- `monitor`
25322532
- `group`
25332533
- `clone` (promotable clones)
2534-
- `ms`/`master` (master-slave) (deprecated)
25352534

25362535
In order to streamline large configurations, it is possible to
25372536
define a template which can later be referenced in primitives:
@@ -2869,7 +2868,7 @@ edit [xml] changed
28692868
****************************
28702869
The edit command sometimes cannot properly handle modifying
28712870
element ids. In particular for elements which belong to group or
2872-
ms resources. Group and ms resources themselves also cannot be
2871+
promotable resources. Group and promotable resources themselves also cannot be
28732872
renamed. Please use the `rename` command instead.
28742873
****************************
28752874

@@ -3231,58 +3230,6 @@ monitor apcfence 60m:60s
32313230
Note that after executing the command, the monitor operation may
32323231
be shown as part of the primitive definition.
32333232

3234-
[[cmdhelp_configure_ms,define a master-slave resource (deprecated)]]
3235-
==== `ms` (`master`)
3236-
3237-
The `ms` command creates a master/slave resource type. It may contain a
3238-
single primitive resource or one group of resources.
3239-
3240-
Usage:
3241-
...............
3242-
ms <name> <rsc>
3243-
[description=<description>]
3244-
[meta attr_list]
3245-
[params attr_list]
3246-
3247-
attr_list :: [$id=<id>] <attr>=<val> [<attr>=<val>...] | $id-ref=<id>
3248-
...............
3249-
Example:
3250-
...............
3251-
ms disk1 drbd1 \
3252-
meta notify=true globally-unique=false
3253-
...............
3254-
3255-
.Note on `ms` deprecated
3256-
****************************
3257-
From Pacemaker-2.0, the resource type referred to as "master/slave",
3258-
"stateful", or "multi-state" is no longer a separate resource type,
3259-
but a variation of clone now referred to as a "promotable clone".
3260-
For backward compatibility, above configurations are also accepted.
3261-
...............
3262-
clone disk1 drbd1 \
3263-
meta promotable=true notify=true globally-unique=false
3264-
...............
3265-
****************************
3266-
3267-
.Note on `id-ref` usage
3268-
****************************
3269-
Instance or meta attributes (`params` and `meta`) may contain
3270-
a reference to another set of attributes. In that case, no other
3271-
attributes are allowed. Since attribute sets' ids, though they do
3272-
exist, are not shown in the `crm`, it is also possible to
3273-
reference an object instead of an attribute set. `crm` will
3274-
automatically replace such a reference with the right id:
3275-
3276-
...............
3277-
crm(live)configure# primitive a2 www-2 meta $id-ref=a1
3278-
crm(live)configure# show a2
3279-
primitive a2 apache \
3280-
meta $id-ref=a1-meta_attributes
3281-
[...]
3282-
...............
3283-
It is advisable to give meaningful names to attribute sets which
3284-
are going to be referenced.
3285-
****************************
32863233

32873234
[[cmdhelp_configure_node,define a cluster node]]
32883235
==== `node`
@@ -3471,6 +3418,26 @@ primitive A ocf:pacemaker:Dummy \
34713418
op_meta 1: timeout=60s
34723419
...............
34733420

3421+
.Note on `id-ref` usage
3422+
****************************
3423+
Instance or meta attributes (`params` and `meta`) may contain
3424+
a reference to another set of attributes. In that case, no other
3425+
attributes are allowed. Since attribute sets' ids, though they do
3426+
exist, are not shown in the `crm`, it is also possible to
3427+
reference an object instead of an attribute set. `crm` will
3428+
automatically replace such a reference with the right id:
3429+
3430+
...............
3431+
crm(live)configure# primitive a2 www-2 meta $id-ref=a1
3432+
crm(live)configure# show a2
3433+
primitive a2 apache \
3434+
meta $id-ref=a1-meta_attributes
3435+
[...]
3436+
...............
3437+
It is advisable to give meaningful names to attribute sets which
3438+
are going to be referenced.
3439+
****************************
3440+
34743441
[[cmdhelp_configure_property,set a cluster property]]
34753442
==== `property`
34763443

@@ -3708,7 +3675,7 @@ The order of resources is significant: it is assumed that later
37083675
resources depend on earlier ones.
37093676

37103677
If a resource is multi-state, it is assumed that the role on
3711-
which later resources depend is master.
3678+
which later resources depend is Promoted.
37123679

37133680
Tests are run sequentially to prevent running the same resource
37143681
on two or more nodes. Tests are carried out only if none of the
@@ -3869,7 +3836,7 @@ show [xml] [<id>
38693836
| obscure:<glob>
38703837
...]
38713838
3872-
type :: node | primitive | group | clone | ms | rsc_template
3839+
type :: node | primitive | group | clone | rsc_template
38733840
| location | colocation | order
38743841
| rsc_ticket
38753842
| property | rsc_defaults | op_defaults
@@ -4789,7 +4756,7 @@ refresh [force]
47894756
Show actions and any failures that happened on all specified
47904757
resources on all nodes. Normally, one gives resource names as
47914758
arguments, but it is also possible to use extended regular
4792-
expressions. Note that neither groups nor clones or master/slave
4759+
expressions. Note that neither groups nor clones or promotable clone
47934760
names are ever logged. The resource command is going to expand
47944761
all of these appropriately, so that clone instances or resources
47954762
which are part of a group are shown.

0 commit comments

Comments
 (0)