mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Fix matching on hosts with custom ports or users set
This is an update of PR #1072 with passing tests Thanks @cheald Fixes #1071 Closes #1072
This commit is contained in:
parent
121f884583
commit
a598601b60
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue