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

Eric Blake eblake at redhat.com
Wed Aug 28 12:38:26 UTC 2013


On 08/28/2013 05:58 AM, Jiri Denemark wrote:

>> +++ b/tools/virt-sanlock-cleanup.in
>> @@ -26,7 +26,8 @@ fi
>>  
>>  LOCKSPACE="__LIBVIRT__DISKS__"
>>  
>> -LOCKDIR=`augtool print '/files at sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir'`
>> +LOCKDIR=`augtool get '/files at sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir'`
>> +LOCKDIR=${LOCKDIR#* = }
> 
> I'm not sure if this is a bashism or not but in case it is, we may need
> to filter the output with sed instead:
> 
> LOCKDIR=`augtool get '/files at sysconfdir@/libvirt/qemu-sanlock.conf/disk_lease_dir' \
>          | sed -e 's/.* = //'`

Fortunately, ${foo#pattern} is portable to POSIX, so you are just fine
doing it in shell without needing a sed.

ACK to the original version.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130828/e73f7393/attachment-0001.sig>


More information about the libvir-list mailing list