aboutsummaryrefslogtreecommitdiffstats
path: root/postgresql-config/src/stage/opt/app
diff options
context:
space:
mode:
authorVijay Venkatesh Kumar <vv770d@att.com>2017-05-16 18:42:56 +0000
committerGerrit Code Review <gerrit@onap.org>2017-05-16 18:42:56 +0000
commit5db86521563297a93af0b4fb4b28f23a2dec0c3e (patch)
tree97720d4cf67e0ec947aad21ab1966556740e4148 /postgresql-config/src/stage/opt/app
parent7c0f3ce19a502317e15f381b15e06930a1952dbc (diff)
parent8cd75a1f6b2b23516d331ed4384d09d111fd6375 (diff)
Merge "[DCAE-20] fix problem with config change"
Diffstat (limited to 'postgresql-config/src/stage/opt/app')
-rw-r--r--postgresql-config/src/stage/opt/app/postgresql-config/etc/do-post-install14
1 files changed, 8 insertions, 6 deletions
diff --git a/postgresql-config/src/stage/opt/app/postgresql-config/etc/do-post-install b/postgresql-config/src/stage/opt/app/postgresql-config/etc/do-post-install
index a20edc6..a6c2bbd 100644
--- a/postgresql-config/src/stage/opt/app/postgresql-config/etc/do-post-install
+++ b/postgresql-config/src/stage/opt/app/postgresql-config/etc/do-post-install
@@ -55,24 +55,26 @@ ismaster=no
case $clustertype in
central )
CONFDIR=/var/config/DCAE/chef
- CONFCOUNT=$(ls $CONFDIR/*-postgres.conf 2>/dev/null | wc -l)
+ CONFDIR2=/tmp
+ CONFCOUNT=$(ls $CONFDIR/*-postgres.conf $CONFDIR2/*-postgres.conf 2>/dev/null | wc -l)
case "$CONFCOUNT" in
1 ) # OpenDCAE
umask 077
TMP=$(mktemp /tmp/tmp.pi1.XXXXXXXXXX)
trap 'rm -f $TMP' 0 1 2 3 15
- sed -e 's/ *: */="/' -e 's/ *$/"/' -e 's/=""/="/' -e 's/""$/"/' < $CONFDIR/*-postgres.conf > $TMP
+ cat $CONFDIR/*-postgres.conf $CONFDIR2/*-postgres.conf 2>/dev/null |
+ sed -e 's/ *: */="/' -e 's/[ ]*$/"/' -e 's/=""/="/' -e 's/""$/"/' > $TMP
. $TMP
- case `hostname` in
- $master ) ismaster=yes ;;
+ case "$master" in
+ `hostname` | `hostname -f` ) ismaster=yes ;;
*?* ) ismaster=no ;;
- '' ) die "master is not set in $CONF"
+ '' ) die "master is not set in $CONF" ;;
esac
PGNODES=$( ${INSTALL_ROOT}/opt/app/cdf/bin/getpropvalue -n pgnodes )
export MASTER=$( gen-repmgr-info -n "$PGNODES" -M "$master" )
[ -n "$MASTER" ] || die "Cannot determine master system. $CONF has '$master' (from env.yaml), which cannot be found in pgnodes."
;;
- 0 ) # not OpenDCAE
+ 0 ) # not OpenDCAE/ONAP
ismaster=yes
PGNODES=$( ${INSTALL_ROOT}/opt/app/cdf/bin/getpropvalue -n pgnodes )
export MASTER=$( gen-repmgr-info -n "$PGNODES" -m )