Skip to content

Commit

Permalink
Merge pull request #112 from chasebolt/dupe-resource
Browse files Browse the repository at this point in the history
fix for resource cloning deprecation
  • Loading branch information
theckman committed Feb 20, 2017
2 parents bbbfa5b + 49ba306 commit f25d1ec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions providers/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,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
Expand All @@ -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
keypair_resource :create
Expand All @@ -62,6 +64,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
keypair_resource :create
Expand All @@ -70,6 +73,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
keypair_resource :create
Expand All @@ -78,6 +82,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
keypair_resource :create
Expand Down Expand Up @@ -193,8 +198,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'
Expand Down Expand Up @@ -230,7 +233,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?

Expand Down

0 comments on commit f25d1ec

Please sign in to comment.