summaryrefslogtreecommitdiff
path: root/lib/chef/environment.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-02-13 09:52:10 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2017-02-13 09:52:10 -0800
commit404a9bc88be538769c6c80b3b31f39a6582991d2 (patch)
tree2f8795e5f64153440c22a522d669c235a627f289 /lib/chef/environment.rb
parentb949a48acc21d4b64869bd7b834708d5232b1f2a (diff)
downloadchef-404a9bc88be538769c6c80b3b31f39a6582991d2.tar.gz
fix specs: RedundantReturn, RedundantSelf, RedundantBegin
department of redundancy department Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/environment.rb')
-rw-r--r--lib/chef/environment.rb20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/chef/environment.rb b/lib/chef/environment.rb
index eb335b0237..545a2e51eb 100644
--- a/lib/chef/environment.rb
+++ b/lib/chef/environment.rb
@@ -247,7 +247,7 @@ class Chef
if Chef::Config[:solo_legacy_mode]
load_from_file(name)
else
- self.from_hash(chef_server_rest.get("environments/#{name}"))
+ from_hash(chef_server_rest.get("environments/#{name}"))
end
end
@@ -309,17 +309,15 @@ class Chef
end
def self.validate_cookbook_version(version)
- begin
- if Chef::Config[:solo_legacy_mode]
- raise Chef::Exceptions::IllegalVersionConstraint,
- "Environment cookbook version constraints not allowed in chef-solo"
- else
- Chef::VersionConstraint.new version
- true
- end
- rescue ArgumentError
- false
+ if Chef::Config[:solo_legacy_mode]
+ raise Chef::Exceptions::IllegalVersionConstraint,
+ "Environment cookbook version constraints not allowed in chef-solo"
+ else
+ Chef::VersionConstraint.new version
+ true
end
+ rescue ArgumentError
+ false
end
end