From 7a00635a57cd54e9199e7b752546582f341050d6 Mon Sep 17 00:00:00 2001 From: toby Date: Fri, 5 Apr 2019 17:58:55 +0000 Subject: [PATCH] adding curl supprt to the qemu-ifup script again --- files/qemu-ifup | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/files/qemu-ifup b/files/qemu-ifup index fc3bf3e..b1fbcb7 100755 --- a/files/qemu-ifup +++ b/files/qemu-ifup @@ -7,10 +7,19 @@ if [ ${#IFACE} -gt 14 ]; then exit 10 fi -source /etc/libvirt/hooks/$IFACE +if [ -e /etc/libvirt/hooks/$IFACE ] + then + source /etc/libvirt/hooks/$IFACE + else + eval $( + curl --fail --connect-timeout 5 -s http://stackapi.usw3.admin.stage.wit.com:4000/network_interface?interface_name=$IFACE && \ + curl --fail --connect-timeout 5 -s http://stackapi.usw3.admin.stage.wit.com:4001/network_interface?interface_name=$IFACE + ) + CLUSTER=${VNI:-""} +fi if ! [[ $CLUSTER =~ ^[0-9]+$ ]]; then - echo "CLUSTER seems not to be valid" + echo "CLUSTER '$CLUSTER' seems not to be valid" exit 10 fi