From 06b3f3ced3c13a07aaa3998bfcb5dd681a407cf1 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 13 Mar 2007 03:18:52 +0000 Subject: [PATCH] Fixed generation of UUIDs to work on upgrades --- ChangeLog | 6 ++++++ libvirt.spec.in | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bcec9857d7..cc30c38e98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Mar 12 23:17:11 EST 2007 Daniel P. Berrange + + * libvirt.spec.in: Don't run UUID generation on first install, + instead run it if there is no in the default network. + This ensures RPM upgrades get a UUID inserted + Mon Mar 12 12:32:11 EST 2007 Daniel P. Berrange * libvirt.spec.in: Generate a random UUID for the default network diff --git a/libvirt.spec.in b/libvirt.spec.in index 8123e886e4..a9015870a6 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -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,,\n $UUID," %{_sysconfdir}/libvirt/qemu/networks/default.xml fi