diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:25:16 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:25:16 -0700 |
commit | 35603c7ce1bd3ccf35334ed65152140f0ecaf080 (patch) | |
tree | 452c84ce196ce00d672c71a8fa65f86c5a074fac /lib/chef/api_client.rb | |
parent | eda2808dce8146bfdb308dd658b1dd565df3562b (diff) | |
download | chef-35603c7ce1bd3ccf35334ed65152140f0ecaf080.tar.gz |
fix Style/HashSyntax
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/api_client.rb')
-rw-r--r-- | lib/chef/api_client.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/chef/api_client.rb b/lib/chef/api_client.rb index 656a0e364f..3120b58cc0 100644 --- a/lib/chef/api_client.rb +++ b/lib/chef/api_client.rb @@ -53,7 +53,7 @@ class Chef set_or_return( :name, arg, - :regex => /^[\-[:alnum:]_\.]+$/ + regex: /^[\-[:alnum:]_\.]+$/ ) end @@ -65,7 +65,7 @@ class Chef set_or_return( :admin, arg, - :kind_of => [ TrueClass, FalseClass ] + kind_of: [ TrueClass, FalseClass ] ) end @@ -77,7 +77,7 @@ class Chef set_or_return( :public_key, arg, - :kind_of => String + kind_of: String ) end @@ -90,7 +90,7 @@ class Chef set_or_return( :validator, arg, - :kind_of => [TrueClass, FalseClass] + kind_of: [TrueClass, FalseClass] ) end @@ -102,7 +102,7 @@ class Chef set_or_return( :private_key, arg, - :kind_of => [String, FalseClass] + kind_of: [String, FalseClass] ) end @@ -145,7 +145,7 @@ class Chef end def self.http_api - Chef::ServerAPI.new(Chef::Config[:chef_server_url], { :api_version => "0" }) + Chef::ServerAPI.new(Chef::Config[:chef_server_url], { api_version: "0" }) end def self.reregister(name) @@ -183,18 +183,18 @@ class Chef # Save this client via the REST API, returns a hash including the private key def save - http_api.put("clients/#{name}", { :name => name, :admin => admin, :validator => validator }) + http_api.put("clients/#{name}", { name: name, admin: admin, validator: validator }) rescue Net::HTTPServerException => e # If that fails, go ahead and try and update it if e.response.code == "404" - http_api.post("clients", { :name => name, :admin => admin, :validator => validator }) + http_api.post("clients", { name: name, admin: admin, validator: validator }) else raise e end end def reregister - reregistered_self = http_api.put("clients/#{name}", { :name => name, :admin => admin, :validator => validator, :private_key => true }) + reregistered_self = http_api.put("clients/#{name}", { name: name, admin: admin, validator: validator, private_key: true }) if reregistered_self.respond_to?(:[]) private_key(reregistered_self["private_key"]) else @@ -219,7 +219,7 @@ class Chef end def http_api - @http_api ||= Chef::ServerAPI.new(Chef::Config[:chef_server_url], { :api_version => "0" }) + @http_api ||= Chef::ServerAPI.new(Chef::Config[:chef_server_url], { api_version: "0" }) end end |