B #5442: get DOMAIN_ID from the deployment file

and optimize domain UUID extraction with awk

(cherry picked from commit cad915746e)
This commit is contained in:
Anton Todorov authored and Ruben S. Montero committed 2021-08-30 21:18:42 +02:00
1 parent 122ab81d27
commit 1a041abb6f
1 file changed
+2 -2
+2 -2
View File
@@ -34,8 +34,8 @@ DATA=`virsh --connect $LIBVIRT_URI create $DEP_FILE`
if [ "x$?" = "x0" ]; then
DOMAIN_ID=$(echo $DATA | sed 's/Domain //' | sed 's/ created from .*$//' | tr -d "'")
UUID=$(virsh --connect $LIBVIRT_URI dominfo $DOMAIN_ID | grep UUID: | awk '{print $2}')
DOMAIN_ID=$(xmllint --xpath '/domain/name/text()' "$DEP_FILE")
UUID=$(virsh --connect $LIBVIRT_URI dominfo $DOMAIN_ID | awk '/UUID:/ {print $2}')
echo $UUID
# redefine potential snapshots