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

Commit

Permalink
#188 On detecting the old properties format, error out and point the …
Browse files Browse the repository at this point in the history
…user to a wiki that explains what needs to be done.
  • Loading branch information
dmcassel committed Apr 17, 2014
1 parent 361dd65 commit 7084d75
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions deploy/lib/ml_rest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,19 @@ def install_properties(path)
file = open(d, "rb")
contents = file.read

# @logger.debug "methods: #{methods}"
url = "http://#{@hostname}:#{@port}/v1/config/properties"

@logger.debug "url: #{url}"
r = go url, "put", headers, nil, contents, @auth_method
if (r.code.to_i < 200 && r.code.to_i > 206)
@logger.error("code: #{r.code.to_i} body:#{r.body}")
if contents.match('<properties')
# Properties is in the correct format
# @logger.debug "methods: #{methods}"
url = "http://#{@hostname}:#{@port}/v1/config/properties"

@logger.debug "url: #{url}"
r = go url, "put", headers, nil, contents, @auth_method
if (r.code.to_i < 200 && r.code.to_i > 206)
@logger.error("code: #{r.code.to_i} body:#{r.body}")
end
else
# Properties file needs to be updated
raise ExitException.new "#{d} is in an old format; changes to this file won't take effect. See https://github.com/marklogic/roxy/wiki/REST-properties-format-change"
end
end
else
Expand Down

0 comments on commit 7084d75

Please sign in to comment.