From 060da55233a9402165fb9be2f84ffb1c3fbf782e Mon Sep 17 00:00:00 2001 From: Murali reddy Date: Thu, 16 Feb 2012 18:47:37 +0530 Subject: [PATCH] bug 13625: F5 - NullPointerException seen when trying to delete/restart a network that was failed to implement properly during implement network Reviewed-By: Abhi status 13625: resolved fixed adding logic to gracefully exit shutdown operation, if earlier network failed to implement --- .../network/ExternalLoadBalancerDeviceManagerImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java index 196a153021d..499b8db5579 100644 --- a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java +++ b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java @@ -926,7 +926,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase // find the load balancer device allocated for the network ExternalLoadBalancerDeviceVO lbDeviceVO = getExternalLoadBalancerForNetwork(guestConfig); if (lbDeviceVO == null) { - s_logger.warn("network shutdwon requested on external load balancer, which did not implement the network." + + s_logger.warn("Network shutdwon requested on external load balancer element, which did not implement the network." + " Either network implement failed half way through or already network shutdown is completed. So just returning."); return true; } @@ -952,6 +952,11 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase } else { // get the self-ip used by the load balancer NicVO selfipNic = getPlaceholderNic(guestConfig); + if (selfipNic == null) { + s_logger.warn("Network shutdwon requested on external load balancer element, which did not implement the network." + + " Either network implement failed half way through or already network shutdown is completed. So just returning."); + return true; + } selfIp = selfipNic.getIp4Address(); }