1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-25 06:03:36 +03:00

B #5442: get DOMAIN_ID from the deployment file

and optimize domain UUID extraction with awk
This commit is contained in:
Anton Todorov 2021-06-30 12:40:32 +03:00 committed by GitHub
parent e201188e06
commit cad915746e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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