summaryrefslogtreecommitdiff
path: root/lib/chef/policy_builder
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-03-14 12:54:35 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-03-14 12:54:35 -0700
commit811abf7591844ef3229c5705e221cbf1e7ea3cd1 (patch)
treeb0f0d6a87e2330916dce134904ba84b4fcaf0a00 /lib/chef/policy_builder
parentab827c15c14429d55064e1978df4c17e20e123ad (diff)
downloadchef-811abf7591844ef3229c5705e221cbf1e7ea3cd1.tar.gz
manual fixing for raise unless
Diffstat (limited to 'lib/chef/policy_builder')
-rw-r--r--lib/chef/policy_builder/policyfile.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb
index e2238d4a73..875ca735c7 100644
--- a/lib/chef/policy_builder/policyfile.rb
+++ b/lib/chef/policy_builder/policyfile.rb
@@ -256,10 +256,9 @@ class Chef
# @api private
def run_list
if named_run_list_requested?
- named_run_list ||
- raise(ConfigurationError,
+ raise ConfigurationError,
"Policy '#{retrieved_policy_name}' revision '#{revision_id}' does not have named_run_list '#{named_run_list_name}'" +
- "(available named_run_lists: [#{available_named_run_lists.join(', ')}])")
+ "(available named_run_lists: [#{available_named_run_lists.join(', ')}])" unless named_run_list
else
policy["run_list"]
end
@@ -321,17 +320,14 @@ class Chef
# @api private
def deployment_group
- Chef::Config[:deployment_group] ||
- raise(ConfigurationError, "Setting `deployment_group` is not configured.")
+ raise ConfigurationError, "Setting `deployment_group` is not configured." unless Chef::Config[:deployment_group]
end
# @api private
def validate_policy_config!
- policy_group ||
- raise(ConfigurationError, "Setting `policy_group` is not configured.")
+ raise ConfigurationError, "Setting `policy_group` is not configured." unless policy_group
- policy_name ||
- raise(ConfigurationError, "Setting `policy_name` is not configured.")
+ raise ConfigurationError, "Setting `policy_name` is not configured." unless policy_name
end
# @api private