From d19f235fe108ce68155ffc49ef0e4ea4d702a3a6 Mon Sep 17 00:00:00 2001 From: RyanH-STFC Date: Fri, 20 Feb 2026 11:15:24 +0000 Subject: [PATCH] Add check to see if FEDID response is valid - added if statement to check the http response code to check if it sent the right data back instead of just accepting all data. --- .../roles/nubes_bootcontext/files/update_cloud_users.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/os_builders/roles/nubes_bootcontext/files/update_cloud_users.sh b/os_builders/roles/nubes_bootcontext/files/update_cloud_users.sh index fa6f143..fbf0112 100644 --- a/os_builders/roles/nubes_bootcontext/files/update_cloud_users.sh +++ b/os_builders/roles/nubes_bootcontext/files/update_cloud_users.sh @@ -22,6 +22,12 @@ fi echo $OPENSTACK_URL +FEDID_RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://$OPENSTACK_URL:9999/cgi-bin/get_username.sh?"$INSTANCEID") +if [[ $FEDID_RESPONSE_CODE != 200 ]]; then + echo "$FEDID_RESPONSE_CODE expected 200" + exit +fi + FEDIDS=$(curl -s http://$OPENSTACK_URL:9999/cgi-bin/get_username_list.sh?"$INSTANCEID") FEDID=$(curl -s http://$OPENSTACK_URL:9999/cgi-bin/get_username.sh?"$INSTANCEID")