From 25e123c787c84c32508d058aa7c5cae4c12283dd Mon Sep 17 00:00:00 2001 From: ioggstream Date: Wed, 30 Aug 2017 17:05:50 +0200 Subject: [PATCH] fix: is_scaleup always return 0 #386 --- fragments/bastion-ansible.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fragments/bastion-ansible.sh b/fragments/bastion-ansible.sh index e04557b..a383a0f 100644 --- a/fragments/bastion-ansible.sh +++ b/fragments/bastion-ansible.sh @@ -130,7 +130,9 @@ function is_scaleup() { # check if diff between old and new inventory file contains only # node changes (ignore 'new_nodes' changes because nodes # are removed from [new_nodes] on the next stack-update run - (diff $ANSDIR/inventory ${ANSDIR}.deployed/inventory | grep '^[<>]' | + # NOTE: disable pipefail or it will always return 0. + (set +o pipefail; + diff $ANSDIR/inventory ${ANSDIR}.deployed/inventory | grep '^[<>]' | grep -v new_nodes | grep -v '[<>] $' | grep -v '.*-node') && return 1 || return 0 }