]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
testnode_start.sh: Detect operating system
authorZack Cerza <zack@redhat.com>
Tue, 4 Jun 2024 22:44:12 +0000 (16:44 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 4 Jun 2024 23:03:50 +0000 (17:03 -0600)
... instead of hardcoding, which is more error-prone.

Signed-off-by: Zack Cerza <zack@redhat.com>
docs/docker-compose/testnode/testnode_start.sh

index d29c3b6d0ae94a6331d7a48fe654337d01f52ca1..196d8a76f61330abba42ec9aca365400a49d6045 100755 (executable)
@@ -3,7 +3,10 @@ set -x
 echo "$SSH_PUBKEY" > /root/.ssh/authorized_keys
 echo "$SSH_PUBKEY" > /home/ubuntu/.ssh/authorized_keys
 chown ubuntu /home/ubuntu/.ssh/authorized_keys
-payload="{\"name\": \"$(hostname)\", \"machine_type\": \"testnode\", \"up\": true, \"locked\": false, \"os_type\": \"ubuntu\", \"os_version\": \"20.04\"}"
+if [ $ID = 'centos' ]; then
+    VERSION_ID=${VERSION_ID}.stream
+fi
+payload="{\"name\": \"$(hostname)\", \"machine_type\": \"testnode\", \"up\": true, \"locked\": false, \"os_type\": \"${ID}\", \"os_version\": \"${VERSION_ID}\"}"
 for i in $(seq 1 5); do
     echo "attempt $i"
     curl -v -f -d "$payload" http://paddles:8080/nodes/ && break