[PATCH] virt-sanlock-cleanup; Fix augtool usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/virt-sanlock-cleanup.in b/tools/virt-sanlock-cleanup.in
index e0e8083..9855f42 100644
--- a/tools/virt-sanlock-cleanup.in
+++ b/tools/virt-sanlock-cleanup.in
@@ -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
-- 
1.8.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]