summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-05-09 12:43:39 -0700
committerTim Smith <tsmith@chef.io>2018-05-09 12:43:39 -0700
commite4b4eeb7c3fa248daa577a5f7e6574ce90bde5ad (patch)
treeb4fb1287da6e33aaad71c535098ecdf7d1a7b934
parentdbee7f652952beb8e1056f6e6731223672788838 (diff)
downloadchef-e4b4eeb7c3fa248daa577a5f7e6574ce90bde5ad.tar.gz
apt_repository: Use the repo_name name property
We'll continue to use the resource name to name the apt_update resource, but all the other actions will use the name property as the user would expect. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/provider/apt_repository.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/provider/apt_repository.rb b/lib/chef/provider/apt_repository.rb
index 91292929e6..fa76ded26c 100644
--- a/lib/chef/provider/apt_repository.rb
+++ b/lib/chef/provider/apt_repository.rb
@@ -66,7 +66,7 @@ class Chef
new_resource.deb_src
)
- declare_resource(:file, "/etc/apt/sources.list.d/#{new_resource.name}.list") do
+ declare_resource(:file, "/etc/apt/sources.list.d/#{new_resource.repo_name}.list") do
owner "root"
group "root"
mode "0644"
@@ -79,9 +79,9 @@ class Chef
end
action :remove do
- if ::File.exist?("/etc/apt/sources.list.d/#{new_resource.name}.list")
- converge_by "Removing #{new_resource.name} repository from /etc/apt/sources.list.d/" do
- declare_resource(:file, "/etc/apt/sources.list.d/#{new_resource.name}.list") do
+ if ::File.exist?("/etc/apt/sources.list.d/#{new_resource.repo_name}.list")
+ converge_by "Removing #{new_resource.repo_name} repository from /etc/apt/sources.list.d/" do
+ declare_resource(:file, "/etc/apt/sources.list.d/#{new_resource.repo_name}.list") do
sensitive new_resource.sensitive
action :delete
notifies :update, "apt_update[#{new_resource.name}]", :immediately if new_resource.cache_rebuild
@@ -93,7 +93,7 @@ class Chef
end
end
else
- logger.trace("/etc/apt/sources.list.d/#{new_resource.name}.list does not exist. Nothing to do")
+ logger.trace("/etc/apt/sources.list.d/#{new_resource.repo_name}.list does not exist. Nothing to do")
end
end