Skip to content

Commit

Permalink
Merge pull request #145 from ochaloup/CLOUD-3447-tx-datasource-mappin…
Browse files Browse the repository at this point in the history
…g-with-driver-fix-warn

[CLOUD-3447] additional fix of warning message
  • Loading branch information
kabir committed Dec 12, 2019
2 parents e7c9711 + 58a2b4b commit f885dc5
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function inject_tx_datasource() {
url=$(find_env "${prefix}_URL")

if [ -z $jndi ] || [ -z $username ] || [ -z $password ] || [ -z $database ]; then
log_warning "Ooops, there is a problem with the ${db,,} datasource!"
log_warning "Ooops, there is a problem with the ${db,,} datasource and JDBC object store creation!"
log_warning "In order to configure ${db,,} transactional datasource for $prefix service you need to provide following environment variables: ${prefix}_USERNAME, ${prefix}_PASSWORD, ${prefix}_DATABASE."
log_warning
log_warning "Current values:"
Expand All @@ -154,8 +154,8 @@ function inject_tx_datasource() {
log_warning "${prefix}_PASSWORD: $password"
log_warning "${prefix}_DATABASE: $database"
log_warning
log_warning "The ${db,,} datasource for $prefix service WILL NOT be configured."
db="ignore"
log_warning "The ${db,,} datasource and JDBC object store for $prefix service WILL NOT be configured."
return
fi

# Transaction isolation level environment variable name format: [NAME]_[DATABASE_TYPE]_TX_ISOLATION
Expand Down Expand Up @@ -185,6 +185,18 @@ function inject_tx_datasource() {
esac
fi

if [ -z "${url}" ]; then
log_warning "Ooops, there is a problem with the ${db,,} datasource and JDBC object store creation!"
log_warning "In order to configure ${db,,} transactional datasource for $prefix service you need to provide environment variables: ${prefix}_URL."
log_warning
log_warning "Current value:"
log_warning
log_warning "${prefix}_URL: $url"
log_warning
log_warning "The ${db,,} datasource and JDBC object store for $prefix service WILL NOT be configured."
return
fi

if [ -z "$driver" ]; then
log_warning "DRIVER not set for tx datasource ${service_name}. Transaction object store datasource will not be configured."
datasource=""
Expand Down

0 comments on commit f885dc5

Please sign in to comment.