diff options
Diffstat (limited to 'lib/chef/api_client/registration.rb')
-rw-r--r-- | lib/chef/api_client/registration.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/chef/api_client/registration.rb b/lib/chef/api_client/registration.rb index 8a5885eff3..de5fc7ac3d 100644 --- a/lib/chef/api_client/registration.rb +++ b/lib/chef/api_client/registration.rb @@ -33,9 +33,10 @@ class Chef attr_reader :destination attr_reader :name - def initialize(name, destination) - @name = name - @destination = destination + def initialize(name, destination, http_api: nil) + @name = name + @destination = destination + @http_api = http_api @server_generated_private_key = nil end @@ -120,11 +121,10 @@ class Chef post_data end - def http_api - @http_api_as_validator ||= Chef::REST.new(Chef::Config[:chef_server_url], - Chef::Config[:validation_client_name], - Chef::Config[:validation_key]) + @http_api ||= Chef::REST.new(Chef::Config[:chef_server_url], + Chef::Config[:validation_client_name], + Chef::Config[:validation_key]) end # Whether or not to generate keys locally and post the public key to the @@ -161,5 +161,3 @@ class Chef end end end - - |