summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-10-05 14:30:49 -0700
committerGitHub <noreply@github.com>2018-10-05 14:30:49 -0700
commitd99ccd95da9955f0bf4e8efb182b3f162457aacc (patch)
tree0097ba80625a87425b8bfa7370bcd9916063c1be
parent09d60a1565e8923f6feb3b58dd1bfacc45538aa5 (diff)
parenta245100e1e2ecb4bba2209a3ca1f9a3744be7cc9 (diff)
downloadchef-d99ccd95da9955f0bf4e8efb182b3f162457aacc.tar.gz
Merge pull request #7719 from bankair/bankair--update-docs-Chef--Knife--Bootstrap-validate_options--for-pr
better docs for Chef::Knife::Bootstrap#validate_options!
-rw-r--r--lib/chef/knife/bootstrap.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index 19a7d6543e..bdeee3394b 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -409,7 +409,13 @@ class Chef
end
end
- # make sure policyfile values are set correctly
+ # Ensure options are valid by checking policyfile values.
+ #
+ # The method call will cause the program to exit(1) if:
+ # * Only one of --policy-name and --policy-group is specified
+ # * Policyfile options are set and --run-list is set as well
+ #
+ # @return [TrueClass] If options are valid.
def validate_options!
if incomplete_policyfile_options?
ui.error("--policy-name and --policy-group must be specified together")