From 77fd0ab5835d47d36cfa8e23c5535a5343740697 Mon Sep 17 00:00:00 2001 From: Patrick Mullaney Date: Wed, 15 Dec 2010 10:39:08 -0800 Subject: [PATCH] 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 --- xenserver/etc_init.d_openvswitch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) -- 2.30.2