diff options
Diffstat (limited to 'lib/chef/environment.rb')
-rw-r--r-- | lib/chef/environment.rb | 20 |
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 |