From 6cf0c5683d518bd6dcd6c51bfa0290e96c6804f3 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 3 Jan 2013 11:47:40 +0100 Subject: [PATCH] Summary: Make canHandle protected Change access to canHandle so it's easier to unittest. Make a note that answers can be null if the host is down, there should be a way to deal with this, but for now an NPE is an adequate indication that something is wrong. --- .../src/com/cloud/network/element/NiciraNvpElement.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java index b1e9af2fd52..0a7d042a96d 100644 --- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java @@ -173,7 +173,7 @@ public class NiciraNvpElement extends AdapterBase implements return Provider.NiciraNvp; } - private boolean canHandle(Network network, Service service) { + protected boolean canHandle(Network network, Service service) { s_logger.debug("Checking if NiciraNvpElement can handle service " + service.getName() + " on network " + network.getDisplayText()); if (network.getBroadcastDomainType() != BroadcastDomainType.Lswitch) { @@ -845,6 +845,7 @@ public class NiciraNvpElement extends AdapterBase implements ConfigurePublicIpsOnLogicalRouterCommand cmd = new ConfigurePublicIpsOnLogicalRouterCommand(routermapping.getLogicalRouterUuid(), niciraNvpHost.getDetail("l3gatewayserviceuuid"), cidrs); ConfigurePublicIpsOnLogicalRouterAnswer answer = (ConfigurePublicIpsOnLogicalRouterAnswer) _agentMgr.easySend(niciraNvpHost.getId(), cmd); + //FIXME answer can be null if the host is down return answer.getResult(); } else {