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 #781 from grtjn/749-app-modules-db-legacy
Browse files Browse the repository at this point in the history
Fixed #749: added app-modules-db prop for legacy with dep warning
  • Loading branch information
RobertSzkutak authored Jun 7, 2017
2 parents 8b3ac5d + f9c4a9e commit 353f2ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deploy/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ app-role=${app-name}-role
content-db=${app-name}-content
modules-db=${app-name}-modules

# Note: purely for legacy support!
app-modules-db=${modules-db}

#
# Number of forests to create per host in the group for the content-db
#
Expand Down
9 changes: 9 additions & 0 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2870,6 +2870,15 @@ def build_config(config_files)
end

def replace_properties(contents, name)
# warn for deprecated properties
deprecated={
"app-modules-db" => "modules-db"
}
contents.scan(/(@ml.|[@$]\{)(app-modules-db)(\}?)/).each do |match|
key=match[1]
logger.warn("Deprecated property #{match.join} used in #{name}, please use ${#{deprecated[key]}} instead!")
end

# make sure to apply descending order to replace @ml.foo-bar before @ml.foo
@properties.sort {|x,y| y <=> x}.each do |k, v|
# new property syntax: @{app-name} or ${app-name}
Expand Down

0 comments on commit 353f2ea

Please sign in to comment.