From 49ba3060d254ea637e99f5ccf30dde21effc6a14 Mon Sep 17 00:00:00 2001 From: Chase Bolt Date: Mon, 20 Feb 2017 11:27:00 -0800 Subject: [PATCH] fix for chef 13 duplication resource deprecation --- providers/account.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/providers/account.rb b/providers/account.rb index 386e8a5..078d420 100644 --- a/providers/account.rb +++ b/providers/account.rb @@ -40,6 +40,7 @@ def load_current_resource action :create do # ~FC017: LWRP does not notify when updated user_resource :create home_dir_resource :create + home_ssh_dir_resource :create if @ssh_keygen || !new_resource.ssh_keys.empty? authorized_keys_resource :create keygen_resource :create group_resource :create @@ -54,6 +55,7 @@ def load_current_resource action :modify do # ~FC017: LWRP does not notify when updated user_resource :modify home_dir_resource :create + home_ssh_dir_resource :create if @ssh_keygen || !new_resource.ssh_keys.empty? authorized_keys_resource :create keygen_resource :create end @@ -61,6 +63,7 @@ def load_current_resource action :manage do # ~FC017: LWRP does not notify when updated user_resource :manage home_dir_resource :create + home_ssh_dir_resource :create if @ssh_keygen || !new_resource.ssh_keys.empty? authorized_keys_resource :create keygen_resource :create end @@ -68,6 +71,7 @@ def load_current_resource action :lock do # ~FC017: LWRP does not notify when updated user_resource :lock home_dir_resource :create + home_ssh_dir_resource :create if @ssh_keygen || !new_resource.ssh_keys.empty? authorized_keys_resource :create keygen_resource :create end @@ -75,6 +79,7 @@ def load_current_resource action :unlock do # ~FC017: LWRP does not notify when updated user_resource :unlock home_dir_resource :create + home_ssh_dir_resource :create if @ssh_keygen || !new_resource.ssh_keys.empty? authorized_keys_resource :create keygen_resource :create end @@ -172,8 +177,6 @@ def authorized_keys_resource(exec_action) # avoid variable scoping issues in resource block ssh_keys = Array(new_resource.ssh_keys) unless ssh_keys.empty? - home_ssh_dir_resource(exec_action) - resource_gid = user_gid r = template "#{@my_home}/.ssh/authorized_keys" do cookbook 'user' @@ -209,7 +212,6 @@ def keygen_resource(exec_action) creates "#{my_home}/.ssh/id_rsa" end - home_ssh_dir_resource(exec_action) e.run_action(:run) if @ssh_keygen && exec_action == :create new_resource.updated_by_last_action(true) if e.updated_by_last_action?