From f4cc5945b4e4b53ff06124b131994056c1483f10 Mon Sep 17 00:00:00 2001 From: Pavel Forkert Date: Thu, 15 Jan 2015 14:28:04 +0200 Subject: [PATCH] Fix accidental port changing when using systemd templates. When you use `port.gsub!` - you are changing the value port variable itself, and as long as the value is not local to this method, but is a part of new_resource record (when it's passed as an array or string) - the previous code will modify `new_resource.port` instance variable. --- providers/container.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/container.rb b/providers/container.rb index f081927607..524c615125 100644 --- a/providers/container.rb +++ b/providers/container.rb @@ -624,7 +624,7 @@ def service_template def sockets return [] if port.empty? - [*port].map { |p| p.gsub!(/.*:/, '') } + [*port].map { |p| p.gsub(/.*:/, '') } end def start