From 88db6b82715ef5188d56ae2404614d6d6ff4db3f Mon Sep 17 00:00:00 2001 From: Bob Ball Date: Fri, 11 Feb 2011 12:35:38 -0800 Subject: [PATCH] xenserver: Don't create XAPI cache at install. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit There are two mechanisms of installing a supplemental pack – one is after installation (using the xe-install-supplemental-pack command) and one is during installation by either creating a new install ISO with the supplemental pack bundled or creating an HTTP directory which serves the install files and the new supplemental pack contents. The RPM should support both methods, but currently attempts to backup data that doesn't exist yet. With this commit, the XAPI cache is not created at install. Signed-off-by: Bob Ball [removed sourcing /etc/xensource-inventory since it is no longer needed] Signed-off-by: Justin Pettit --- xenserver/openvswitch-xen.spec | 35 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec index 1df6dff5..de9b4439 100644 --- a/xenserver/openvswitch-xen.spec +++ b/xenserver/openvswitch-xen.spec @@ -109,23 +109,26 @@ install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch rm -rf $RPM_BUILD_ROOT %post -if test ! -e /var/xapi/network.dbcache; then - if test "$1" = 1; then - printf "Creating xapi database cache... " - else - printf "warning: Open vSwitch is being re-installed or upgraded,\n" - printf " but the xapi database cache is missing.\n" - printf "Re-creating xapi database cache... " - fi +# Do not run the first block if we are in the XenServer installer +if runlevel >/dev/null 2>&1; then + if test ! -e /var/xapi/network.dbcache; then + if test "$1" = 1; then + printf "Creating xapi database cache... " + else + printf "warning: Open vSwitch is being re-installed or upgraded,\n" + printf " but the xapi database cache is missing.\n" + printf "Re-creating xapi database cache... " + fi - if /usr/share/openvswitch/scripts/interface-reconfigure rewrite; then - printf "done.\n" - else - printf "FAILED\n" - printf "Open vSwitch can only be installed on a XenServer that\n" - printf "has connectivity to xapi on the pool master. Please\n" - printf "fix connectivity to the pool master, then try again.\n" - exit 1 + if /usr/share/openvswitch/scripts/interface-reconfigure rewrite; then + printf "done.\n" + else + printf "FAILED\n" + printf "Open vSwitch can only be installed on a XenServer that\n" + printf "has connectivity to xapi on the pool master. Please\n" + printf "fix connectivity to the pool master, then try again.\n" + exit 1 + fi fi fi -- 2.30.2