]> xenbits.xensource.com Git - libvirt.git/commitdiff
virt-sanlock-cleanup; Fix augtool usage
authorJiri Denemark <jdenemar@redhat.com>
Wed, 28 Aug 2013 11:50:10 +0000 (13:50 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 28 Aug 2013 11:50:10 +0000 (13:50 +0200)
Surprisingly, augtool get (or print) returns "path = value" while we are
only interested in the value. We need to remove the "path = " part from
the augtool's output. The following is an example of the augtool command
as used in virt-sanlock-cleanup script:

$ augtool get /files/etc/libvirt/qemu-sanlock.conf/disk_lease_dir
/files/etc/libvirt/qemu-sanlock.conf/disk_lease_dir = /var/lib/libvirt/sanlock

tools/virt-sanlock-cleanup.in

index e0e8083588e99de05b063106ba5ce36d7729bf17..9855f4244e9e93e6ad2c2222876480f54b2f194f 100644 (file)
@@ -26,7 +26,8 @@ fi
 
 LOCKSPACE="__LIBVIRT__DISKS__"
 
-LOCKDIR=`augtool print '/files@sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir'`
+LOCKDIR=`augtool get '/files@sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir'`
+LOCKDIR=${LOCKDIR#* = }
 if test $? != 0 || test "x$LOCKDIR" = "x" ; then
   LOCKDIR="@localstatedir@/lib/libvirt/sanlock"
 fi