fix vm vagrant

This commit is contained in:
2024-12-23 14:51:48 +01:00
parent b73f123b5f
commit 4d22bfb766
5 changed files with 44 additions and 29 deletions

View File

@ -1,10 +1,10 @@
# commun fonctions for KAZ
#TODO; toutes les fonctions ci-dessous devraient être commentées
#TODO; toutes les fonctions ci-dessous devraient être commentées
#KI : françois
#KOI : tout un tas de trucs utiles pour la gestion de l'infra kaz (à mettre dans chaque script)
#KAN :
#KAN :
# maj le 27/01/2024 by FAB: recherche de tous les srv kaz dispo (via le DNS)
# maj le 15/04/2024 by FAB: correction getPahekoOrgaList
@ -139,13 +139,13 @@ getAvailableOrgas () {
#en entrée
SITE_DST="$1"
if [ -n "${SITE_DST}" ];then
ssh -p 2201 root@${SITE_DST}.${domain} "ls \"${KAZ_COMP_DIR}\" | grep -- \"^.*-orga$\""
else
ls "${KAZ_COMP_DIR}" | grep -- "^.*-orga$"
fi
ls "${KAZ_COMP_DIR}" | grep -- "^.*-orga$"
fi
}
getAvailableServices () {
@ -224,10 +224,10 @@ waitUrl () {
# $1 URL to waitfor
# $2 timeout en secondes (optional)
starttime=$(date +%s)
if [[ $(curl --connect-timeout 2 -s -D - "$1" -o /dev/null 2>/dev/null | head -n1) != *[23]0[0-9]* ]]; then
if [[ $(curl -k --connect-timeout 2 -s -D - "$1" -o /dev/null 2>/dev/null | head -n1) != *[23]0[0-9]* ]]; then
printKazMsg "service not available ($1). Please wait..."
echo curl --connect-timeout 2 -s -D - "$1" -o /dev/null \| head -n1
while [[ $(curl --connect-timeout 2 -s -D - "$1" -o /dev/null 2>/dev/null | head -n1) != *[23]0[0-9]* ]]
echo curl -k --connect-timeout 2 -s -D - "$1" -o /dev/null \| head -n1
while [[ $(curl -k --connect-timeout 2 -s -D - "$1" -o /dev/null 2>/dev/null | head -n1) != *[23]0[0-9]* ]]
do
sleep 5
if [ $# -gt 1 ]; then
@ -244,7 +244,7 @@ waitUrl () {
waitContainerHealthy () {
# $1 ContainerName
# $2 timeout en secondes (optional)
healthy="false"
starttime=$(date +%s)
running="false"
@ -270,7 +270,7 @@ waitContainerHealthy () {
waitContainerRunning () {
# $1 ContainerName
# $2 timeout en secondes (optional)
starttime=$(date +%s)
running="false"
[[ $(docker ps -f name="$1" | grep -w "$1") ]] && running="true"