Fixed generation of UUIDs to work on upgrades

This commit is contained in:
Daniel P. Berrange 2007-03-13 03:18:52 +00:00
parent afa1d92a9f
commit 06b3f3ced3
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Mon Mar 12 23:17:11 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* libvirt.spec.in: Don't run UUID generation on first install,
instead run it if there is no <uuid> in the default network.
This ensures RPM upgrades get a UUID inserted
Mon Mar 12 12:32:11 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* libvirt.spec.in: Generate a random UUID for the default network

View File

@ -84,7 +84,8 @@ rm -fr %{buildroot}
%post
/sbin/ldconfig
/sbin/chkconfig --add libvirtd
if [ $1 = 1 ]; then
grep uuid %{_sysconfdir}/libvirt/qemu/networks/default.xml 1>/dev/null 2>&1
if [ $? != 0 ]; then
UUID=`/usr/bin/uuidgen`
sed -i -e "s,</name>,</name>\n <uuid>$UUID</uuid>," %{_sysconfdir}/libvirt/qemu/networks/default.xml
fi