From b06123cc04d5a6461f15eb1f837c12d04e98a62a Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 25 Feb 2019 11:52:47 +0100 Subject: [PATCH] sync host --- scripts/onehost_create_all | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/onehost_create_all b/scripts/onehost_create_all index fefb1c4..411f892 100755 --- a/scripts/onehost_create_all +++ b/scripts/onehost_create_all @@ -39,6 +39,21 @@ function register_node() return $? } +# Fix host creation error from 5.6.1 with sync methode rsync +function sync_host() +{ + CMD="onehost" + OPT="sync -f --rsync" + AUTH=$(get_one_auth) + res=$(su - oneadmin -c "${CMD} ${OPT} --user ${AUTH%:*} --password ${AUTH#*:}") + if [[ ${?} -ne 0 ]] + then + error "Hosts sync failed" + else + echo "Hosts sync OK" + fi +} + # # NAME: wait_node_ok # AIM: Wait until the node is OK or ERROR @@ -58,7 +73,7 @@ function wait_node_ok() [[ ${st} == '' ]] && break if [[ ${st} == "ERROR" ]] then - RET=2 + RET=50 break fi @@ -122,6 +137,7 @@ for host in ${HAPY_SLV}; do EchoVert " * Enregistrement du noeud" register_node ${host} + sync_host ${host} wait_node_ok ${host} if [[ ${?} -ne 0 ]] then