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: bootstrap: Option -N should require option -y #1657

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
2 changes: 2 additions & 0 deletions crmsh/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ def _validate_nodes_option(self):
"""
Validate -N/--nodes option
"""
if self.user_at_node_list and not self.yes_to_all:
utils.fatal("Can't use -N/--nodes option without -y/--yes option")
if self.user_at_node_list and self.stage:
utils.fatal("Can't use -N/--nodes option and stage({}) together".format(self.stage))
me = utils.this_node()
Expand Down
2 changes: 2 additions & 0 deletions test/features/bootstrap_options.feature
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Feature: crmsh bootstrap process - options
Then Expected "-x option or SKIP_CSYNC2_SYNC can't be used with any stage" in stderr
When Try "crm cluster init -i eth0 -i eth1 -i eth2 -y" on "hanode1"
Then Expected "Maximum number of interface is 2" in stderr
When Try "crm cluster init -N hanode2" on "hanode1"
Then Expected "Can't use -N/--nodes option without -y/--yes option" in stderr
When Try "crm cluster init sbd -N hanode1 -N hanode2 -y" on "hanode1"
Then Expected "Can't use -N/--nodes option and stage(sbd) together" in stderr

Expand Down