Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Fix #591: overriding property from command line #623

Merged
merged 1 commit into from
Aug 23, 2016
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
4 changes: 2 additions & 2 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2556,9 +2556,9 @@ def ServerConfig.properties(prop_file_location = @@path)

properties.merge!(ServerConfig.load_properties(env_properties_file, "ml.")) if File.exists? env_properties_file

properties = ServerConfig.substitute_properties(properties, properties, "ml.")

properties = load_prop_from_args(properties)

properties = ServerConfig.substitute_properties(properties, properties, "ml.")
end

end
2 changes: 2 additions & 0 deletions deploy/test/data/ml7-properties/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,5 @@ local-server=localhost
#cert-server=
#prod-server=
yoda-age=
dummy-port=9999
dummy2-port=${dummy-port}
18 changes: 18 additions & 0 deletions deploy/test/test_server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,24 @@

end

# issue #591
describe "override properties from command" do

before do
ARGV << "--ml.dummy-port=8888"
@properties = ServerConfig.properties(File.expand_path("../data/ml7-properties/", __FILE__))
end

it "should load valid properites from a command" do
@properties['ml.dummy-port'].must_equal '8888'
@properties['ml.dummy2-port'].must_equal '8888'
end

after do
ARGV.shift
ARGV.shift
end
end

def with_stdin
stdin = $stdin # remember $stdin
Expand Down