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

Commit

Permalink
Merge pull request #623 from rlouapre/issue-591
Browse files Browse the repository at this point in the history
Fix #591: overriding property from command line
  • Loading branch information
RobertSzkutak committed Aug 23, 2016
2 parents 8e6fd83 + 259f1fe commit 2e279b6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2671,9 +2671,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

0 comments on commit 2e279b6

Please sign in to comment.