diff options
author | Thom May <thom@chef.io> | 2016-01-14 14:08:03 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-01-14 14:08:03 +0000 |
commit | 51cfbdc4d16739caac4d946fadbe678444aafe34 (patch) | |
tree | 56dfd8f1cd9fd933de27268b32402e955a43ac2b /lib/chef/key.rb | |
parent | 05064423057d4cf46f4713b81b08829cf6d20af6 (diff) | |
download | chef-51cfbdc4d16739caac4d946fadbe678444aafe34.tar.gz |
Use double quotes by default
This is an entirely mechanically generated (chefstyle -a) change, to go
along with chef/chefstyle#5 . We should pick something and use it
consistently, and my opinion is that double quotes are the appropriate
thing.
Diffstat (limited to 'lib/chef/key.rb')
-rw-r--r-- | lib/chef/key.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/chef/key.rb b/lib/chef/key.rb index 714dfc3f60..ba5613e35e 100644 --- a/lib/chef/key.rb +++ b/lib/chef/key.rb @@ -16,10 +16,10 @@ # limitations under the License. # -require 'chef/json_compat' -require 'chef/mixin/params_validate' -require 'chef/exceptions' -require 'chef/server_api' +require "chef/json_compat" +require "chef/mixin/params_validate" +require "chef/exceptions" +require "chef/server_api" class Chef # Class for interacting with a chef key object. Can be used to create new keys, @@ -149,9 +149,9 @@ class Chef end payload = {"name" => @name} - payload['public_key'] = @public_key unless @public_key.nil? - payload['create_key'] = @create_key if @create_key - payload['expiration_date'] = @expiration_date unless @expiration_date.nil? + payload["public_key"] = @public_key unless @public_key.nil? + payload["create_key"] = @create_key if @create_key + payload["expiration_date"] = @expiration_date unless @expiration_date.nil? result = chef_rest.post("#{api_base}/#{@actor}/keys", payload) # append the private key to the current key if the server returned one, # since the POST endpoint just returns uri and private_key if needed. @@ -210,11 +210,11 @@ class Chef else raise Chef::Exceptions::MissingKeyAttribute, "The hash passed to from_hash does not contain the key 'user' or 'client'. Please pass a hash that defines one of those keys." end - key.name key_hash['name'] if key_hash.key?('name') - key.public_key key_hash['public_key'] if key_hash.key?('public_key') - key.private_key key_hash['private_key'] if key_hash.key?('private_key') - key.create_key key_hash['create_key'] if key_hash.key?('create_key') - key.expiration_date key_hash['expiration_date'] if key_hash.key?('expiration_date') + key.name key_hash["name"] if key_hash.key?("name") + key.public_key key_hash["public_key"] if key_hash.key?("public_key") + key.private_key key_hash["private_key"] if key_hash.key?("private_key") + key.create_key key_hash["create_key"] if key_hash.key?("create_key") + key.expiration_date key_hash["expiration_date"] if key_hash.key?("expiration_date") key end @@ -252,7 +252,7 @@ class Chef OpenSSL::ASN1::Integer.new(openssl_key_object.public_key.n), OpenSSL::ASN1::Integer.new(openssl_key_object.public_key.e), ]) - OpenSSL::Digest::SHA1.hexdigest(data_string.to_der).scan(/../).join(':') + OpenSSL::Digest::SHA1.hexdigest(data_string.to_der).scan(/../).join(":") end private |