From: Patrick Mullaney Date: Wed, 15 Dec 2010 18:39:08 +0000 (-0800) Subject: xenserver: Don't require /etc/xensource/network.conf if not on XenServer. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77fd0ab5835d47d36cfa8e23c5535a5343740697;p=openvswitch xenserver: Don't require /etc/xensource/network.conf if not on XenServer. On XenServer systems, the "network mode" (that is, whether the network uses OpenvSwitch or the Linux bridge) is stored in /etc/xensource/network.conf. On other systems, we can't expect it to be there. This changes the init script to tolerate its absence, treating that as meaning that Open vSwitch should be used (otherwise, why did the admin install it?). NETWORK_MODE can always be overridden in /etc/sysconfig/openvswitch anyway. Signed-off-by: Patrick Mullaney [changed back to read /etc/xensource/network.conf if present] Signed-off-by: Ben Pfaff --- diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch index 31aa3fbc..b0f8f620 100755 --- a/xenserver/etc_init.d_openvswitch +++ b/xenserver/etc_init.d_openvswitch @@ -57,11 +57,13 @@ else } fi -. /etc/xensource-inventory +test -e /etc/xensource-inventory && . /etc/xensource-inventory test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch +if test -e /etc/xensource/network.conf; then + NETWORK_MODE=$(cat /etc/xensource/network.conf) +fi -NETWORK_MODE=$(cat /etc/xensource/network.conf) -case $NETWORK_MODE in +case ${NETWORK_MODE:=openvswitch} in vswitch|openvswitch) ;; bridge)