summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Gorodetsky <v@gor.io>2016-09-07 18:27:33 +0300
committerVlad Gorodetsky <v@gor.io>2016-09-19 10:09:18 +0300
commitc7a9d89d4cbc7a2b794bc25d13100915149dc02f (patch)
treedba0b39e8305254e4ace2fd1dc35abd7bf326b03
parented21f8cff3d816394fb50258e1ea27ac2fc89a5a (diff)
downloadchef-c7a9d89d4cbc7a2b794bc25d13100915149dc02f.tar.gz
Normalize full key name to avoid resource update on identical key names
-rw-r--r--lib/chef/provider/apt_repository.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/apt_repository.rb b/lib/chef/provider/apt_repository.rb
index 9e077c8cbb..9e91b12373 100644
--- a/lib/chef/provider/apt_repository.rb
+++ b/lib/chef/provider/apt_repository.rb
@@ -153,7 +153,7 @@ class Chef
end
def install_key_from_uri
- key_name = new_resource.key.split(%r{\/}).last
+ key_name = new_resource.key.gsub(/[^0-9A-Za-z\-]/, "_")
cached_keyfile = ::File.join(Chef::Config[:file_cache_path], key_name)
type = if new_resource.key.start_with?("http")
:remote_file