xenserver: Don't create XAPI cache at install.
authorBob Ball <bob.ball@citrix.com>
Fri, 11 Feb 2011 20:35:38 +0000 (12:35 -0800)
committerAndrew Evans <aevans@nicira.com>
Fri, 11 Feb 2011 21:16:35 +0000 (13:16 -0800)
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@citrix.com>
[removed sourcing /etc/xensource-inventory since it is no longer needed]
Signed-off-by: Justin Pettit <jpettit@nicira.com>
xenserver/openvswitch-xen.spec

index 1df6dff568b713f4b4559872a70e6f1e758103c9..de9b4439df2e5534be516c9c60fb027141ccf072 100644 (file)
@@ -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