Skip to content
This repository has been archived by the owner on Mar 21, 2018. It is now read-only.

Commit

Permalink
Merge pull request #276 from RiotGames/sethvargo/delayed_defaults
Browse files Browse the repository at this point in the history
Use lazy defaults for Chef Config
  • Loading branch information
reset committed Aug 20, 2014
2 parents e553d88 + 19a3e94 commit aa118f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/ridley/chef/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ def working_dir
set_assignment_mode :carefree

attribute :node_name,
default: Socket.gethostname
default: -> { Socket.gethostname }
attribute :chef_server_url,
default: 'http://localhost:4000'
attribute :client_key,
default: platform_specific_path('/etc/chef/client.pem')
default: -> { platform_specific_path('/etc/chef/client.pem') }
attribute :validation_key,
default: platform_specific_path('/etc/chef/validation.pem')
default: -> { platform_specific_path('/etc/chef/validation.pem') }
attribute :validation_client_name,
default: 'chef-validator'

Expand All @@ -70,9 +70,9 @@ def working_dir
# deprecated in chef/config.rb but doesn't currently trigger a warning.
# See also: CHEF-3715
attribute :syntax_check_cache_path,
default: Dir.mktmpdir
default: -> { Dir.mktmpdir }
attribute :cache_options,
default: { path: defined?(syntax_check_cache_path) ? syntax_check_cache_path : Dir.mktmpdir }
default: -> { { path: defined?(syntax_check_cache_path) ? syntax_check_cache_path : Dir.mktmpdir } }

# Create a new Chef Config object.
#
Expand Down

0 comments on commit aa118f8

Please sign in to comment.