From 7084d752fea2953566ab928ee4a9719adca405ae Mon Sep 17 00:00:00 2001 From: Dave Cassel Date: Thu, 17 Apr 2014 16:08:00 -0400 Subject: [PATCH] #188 On detecting the old properties format, error out and point the user to a wiki that explains what needs to be done. --- deploy/lib/ml_rest.rb | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/deploy/lib/ml_rest.rb b/deploy/lib/ml_rest.rb index 8f1c0a5a..3891531e 100644 --- a/deploy/lib/ml_rest.rb +++ b/deploy/lib/ml_rest.rb @@ -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(' 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