diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py index d83a1a67d5..441aab1ff3 100644 --- a/crmsh/bootstrap.py +++ b/crmsh/bootstrap.py @@ -238,6 +238,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() diff --git a/test/features/bootstrap_options.feature b/test/features/bootstrap_options.feature index bf1909b6c8..7e44b90502 100644 --- a/test/features/bootstrap_options.feature +++ b/test/features/bootstrap_options.feature @@ -34,6 +34,8 @@ Feature: crmsh bootstrap process - options """ When Try "crm cluster init sbd -x -y" on "hanode1" Then Expected "-x option or SKIP_CSYNC2_SYNC can't be used with any stage" 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 When Try "crm corosync link help add" on "hanode1"