diff --git a/CHANGELOG.md b/CHANGELOG.md index 62d96394..020d530b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Reverse Chronological Order: https://github.com/capistrano/capistrano/compare/v3.2.1...HEAD * Enhancements (@townsen) + * Fix matching on hosts with custom ports or users set * Previously filtering would affect any generated configuration files so that files newly deployed would not be the same as those on the hosts previously deployed (and now excluded by filters). This is almost certainly not what is diff --git a/lib/capistrano/configuration/servers.rb b/lib/capistrano/configuration/servers.rb index e2935a37..0527b432 100644 --- a/lib/capistrano/configuration/servers.rb +++ b/lib/capistrano/configuration/servers.rb @@ -8,7 +8,7 @@ module Capistrano include Enumerable def add_host(host, properties={}) - servers.add server(host).with(properties) + servers.add server(host, properties).with(properties) end def add_role(role, hosts, options={}) @@ -33,8 +33,9 @@ module Capistrano private - def server(host) - servers.find { |server| server.matches? Server[host] } || Server[host] + def server(host, properties) + new_host = Server[host].with(properties) + servers.find { |server| server.matches? new_host } || new_host end def servers