[ovs-dev] [RPMs v2 4/4] xenserver: Don't create XAPI cache at install.

Justin Pettit jpettit at nicira.com
Fri Feb 11 20:35:38 UTC 2011


From: Bob Ball <bob.ball at citrix.com>

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 <bob.ball at citrix.com>
---
 xenserver/openvswitch-xen.spec |   37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/xenserver/openvswitch-xen.spec b/xenserver/openvswitch-xen.spec
index 1df6dff..de9b443 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
 
-- 
1.7.1





More information about the dev mailing list