From 8cd75a1f6b2b23516d331ed4384d09d111fd6375 Mon Sep 17 00:00:00 2001 From: Tony Hansen Date: Tue, 16 May 2017 18:29:42 +0000 Subject: [DCAE-20] fix problem with config change Change-Id: I46deeefb75c31be2e2eaa0c50d70bc435aa38ff3 Signed-off-by: Tony Hansen --- .../cdf-prop-value/src/main/java/cdf-prop-value.jar | Bin 1593 -> 1593 bytes .../cdf-util/src/main/java/cdf-util.jar | Bin 31099 -> 31099 bytes .../opt/app/postgresql-config/etc/do-post-install | 14 ++++++++------ postgresql-prep/src/common/postinst | 8 +++++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar index 1f9a1c9..b8475b5 100644 Binary files a/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar and b/cdf/src/cdf-prop-value/cdf-prop-value/src/main/java/cdf-prop-value.jar differ diff --git a/cdf/src/cdf-prop-value/cdf-util/src/main/java/cdf-util.jar b/cdf/src/cdf-prop-value/cdf-util/src/main/java/cdf-util.jar index a5a86a6..88cdc2d 100644 Binary files a/cdf/src/cdf-prop-value/cdf-util/src/main/java/cdf-util.jar and b/cdf/src/cdf-prop-value/cdf-util/src/main/java/cdf-util.jar differ 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 ) diff --git a/postgresql-prep/src/common/postinst b/postgresql-prep/src/common/postinst index 6f0218e..1f8eb39 100755 --- a/postgresql-prep/src/common/postinst +++ b/postgresql-prep/src/common/postinst @@ -44,7 +44,8 @@ then INSTALL_ROOT= fi 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 ) # master: masternode @@ -56,12 +57,13 @@ case "$CONFCOUNT" in # PG_NODES : uiopmno1qwpstg00.research.example.com|asbczw1vepstg00.dcae.simpledemo.openecomp.org # PG_JAVA_HOME : /opt/app/java/jdk/jdk170 # PG_CLUSTER : global - cat $CONFDIR/*-postgres.conf | sed -e 's/ *: */="/' -e 's/[ ]*$/"/' -e 's/=""/="/' -e 's/""$/"/' > $TMP + cat $CONFDIR/*-postgres.conf $CONFDIR2/*-postgres.conf 2>/dev/null | + sed -e 's/ *: */="/' -e 's/[ ]*$/"/' -e 's/=""/="/' -e 's/""$/"/' > $TMP . $TMP ;; 0 ) ;; * ) - die "More than one postgres.conf was found: $(ls $CONFDIR/*-postgres.conf 2>&1)" + die "More than one postgres.conf was found: $(ls $CONFDIR/*-postgres.conf $CONFDIR2/*-postgres.conf 2>/dev/null)" esac [ -n "$PG_NODES" ] || die "PG_NODES is not set" -- cgit 1.2.3-korg