From 816a5affab83ff52c6f893c2c1f1072ee5a079f6 Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Fri, 18 Dec 2009 23:22:38 +0100 Subject: Attempt to work around both static configs and dynamic configs on load balancer upgrades. Needs testing on live installs 1.2 => 2.0. --- etc/inc/upgrade_config.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 9a45d38..7f7b404 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1537,6 +1537,7 @@ function upgrade_053_to_054() { $lbpool_arr = $config['load_balancer']['lbpool']; $lbpool_srv_arr = array(); $gateway_group_arr = array(); + $gateways = return_gateways_array(); foreach($lbpool_arr as $lbpool) { if($lbpool['type'] == "gateway") { $gateway_group['name'] = $lbpool['name']; @@ -1547,9 +1548,10 @@ function upgrade_053_to_054() { foreach($lbpool['servers'] as $member) { $split = split("\|", $member); $interface = $split[0]; - /* on a upgraded configuration we automatically append _GW */ - /* FIXME: This won't work for dhcp or pppoe ofcourse, it needs the plain interface name for that. */ - $interface = strtoupper($interface) . "_GW"; + /* on static upgraded configuration we automatically append _GW */ + if(is_array($gateways['{$interface}_GW'])) { + $interface = strtoupper($interface) . "_GW"; + } $monitor = $split[1]; /* on failover increment tier. Else always assign 1 */ if($lbpool['behaviour'] == "failover") { -- cgit v1.1