Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[crmsh-4.6] Dev: ui_context: ignore requirements when option --help is specified #1404

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crmsh/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,5 +512,6 @@
RSC_ROLE_UNPROMOTED_LEGACY = "Slave"
PCMK_VERSION_DEFAULT = "2.0.0"

NON_FUNCTIONAL_COMMANDS = ('help', 'cd', 'ls', 'quit', 'up')
NON_FUNCTIONAL_COMMANDS = {'help', 'cd', 'ls', 'quit', 'up'}
NON_FUNCTIONAL_OPTIONS = {'--help', '--help-without-redirect'}
# vim:ts=4:sw=4:et:
3 changes: 2 additions & 1 deletion crmsh/ui_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def run(self, line):
cmd = True
break
if cmd:
if self.command_name not in constants.NON_FUNCTIONAL_COMMANDS:
if self.command_name not in constants.NON_FUNCTIONAL_COMMANDS\
and all(arg not in constants.NON_FUNCTIONAL_OPTIONS for arg in self.command_args):
entry = self.current_level()
if 'requires' in dir(entry) and not entry.requires():
self.fatal_error("Missing requirements")
Expand Down
2 changes: 0 additions & 2 deletions doc/toolchain/bin/adocxt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ RE_SECTION_TITLE = re.compile('^=')
RE_FROM_CODE_OR_SECTION_TITLE=re.compile(r'^(?:\[\[([^,]+),[^,]*,From Code]]$|=)')

TAG_EXCLUDES = {
'cmdhelp_node_online',
'cmdhelp_node_standby',
'cmdhelp_root_report',
}

Expand Down
32 changes: 28 additions & 4 deletions doc/website-v1/man-4.6.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2479,9 +2479,20 @@ maintenance [<node>]

[[cmdhelp_node_online,set node online,From Code]]
==== `online`
See "crm node help online" or "crm node online --help"
Usage:

online [--all | <node>... ]

Specify node(s) on which to online node. If no nodes are specified, online node on the local node. If --all is specified, online node on all nodes.

Options:

* `+++-h, --help+++`: Show this help message

* `+++--all+++`: To online node on all nodes



[[cmdhelp_node_ready,put node into ready mode]]
==== `ready`

Set the node's maintenance status to `off`. The node should be
Expand Down Expand Up @@ -2523,9 +2534,22 @@ show [<node>]

[[cmdhelp_node_standby,put node into standby,From Code]]
==== `standby`
See "crm node help standby" or "crm node standby --help"
Usage:

standby [--all | <node>... ] [lifetime]

Specify node(s) on which to standby node. If no nodes are specified, standby node on the local node. If --all is specified, standby node on all nodes.

Additionally, you may specify a lifetime for the standby---if set to "reboot", the node will be back online once it reboots. "forever" will keep the node in standby after reboot. The life time defaults to "forever".

Options:

* `+++-h, --help+++`: Show this help message

* `+++--all+++`: To standby node on all nodes



[[cmdhelp_node_status-attr,manage status attributes]]
==== `status-attr`

Edit node attributes which are in the CIB status section, i.e.,
Expand Down
Loading