Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

(#290) Strip spaces from host/port lists #317

Merged
merged 1 commit into from
Aug 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
|Date |Issue |Description |
|----------|------|---------------------------------------------------------------------------------------------------------|
|2017/08/19|290 |Strip spaces off comma separated host lists to allow for space between hosts
|2017/08/18|314 |Fix fact filters in JSON transport mode |
|2017/08/18|307 |When the client is run as root raise an informative error rather than fail silently |
|2017/08/16|308 |Remove hard dependency on ajcrowe/supervisord |
Expand Down
2 changes: 1 addition & 1 deletion lib/mcollective/util/choria.rb
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def check_ssl_setup(log=true)
def server_resolver(config_option, srv_records, default_host=nil, default_port=nil)
if servers = get_option(config_option, nil)
hosts = servers.split(",").map do |server|
server.split(":")
server.split(":").map(&:strip)
end

return hosts
Expand Down
5 changes: 3 additions & 2 deletions spec/unit/mcollective/util/choria_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@ module Util

describe "#server_resolver" do
it "should support config" do
Config.instance.stubs(:pluginconf).returns("choria.middleware_hosts" => "1.net:4222,2.net:4223")
Config.instance.stubs(:pluginconf).returns("choria.middleware_hosts" => "1.net:4222,2.net:4223, 3.net:4224 ")
expect(choria.server_resolver("choria.middleware_hosts", ["srv_record"], "h", "1")).to eq(
[
["1.net", "4222"],
["2.net", "4223"]
["2.net", "4223"],
["3.net", "4224"]
]
)
end
Expand Down