From e40686a13c451cdf33b8b04ab2336f106dc8de6b Mon Sep 17 00:00:00 2001 From: oiseauroch Date: Sat, 16 Dec 2023 20:59:36 +0100 Subject: [PATCH] fix test enough nodes --- scripts/_common.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 55ecd08..9bc28f6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -43,13 +43,14 @@ apply_layout() { garage_command=$1 $garage_command layout show 2>/dev/null - local layout_version=$($garage_command layout show 2>/dev/null | grep -Po -- "(?<=--version).*" | head -1 | xargs) + if [ "$(./garage -c garage.toml layout show | grep 'This new layout cannot yet be applied')" ] if [ "$layout_version" != "" ] then - $garage_command layout apply --version $layout_version - else ynh_print_warn --message="Unable to apply layout. No enough nodes" return 0 + else + local layout_version=$($garage_command layout show 2>/dev/null | grep -Po -- "(?<=--version).*" | head -1 | xargs) + $garage_command layout apply --version $layout_version fi }