Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Louapre committed Jun 26, 2016
1 parent bd1e1bf commit 875ac3c
Show file tree
Hide file tree
Showing 3 changed files with 24 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 @@ -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}
20 changes: 20 additions & 0 deletions deploy/test/test_server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,26 @@

end

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

before do
ARGV << "--ml.dummy-port=8888"
# @logger = MiniTest::Mock.new
# ServerConfig.logger = @logger
@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 875ac3c

Please sign in to comment.