You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2015/04/12 20:23:29 UTC
git commit: updated refs/heads/master to 9f8a40a
Repository: cloudstack
Updated Branches:
refs/heads/master cb02a32f7 -> 9f8a40acd
findbugs: unnecesarry null return in utility function removed;
Category BAD_PRACTICE
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9f8a40ac
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9f8a40ac
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9f8a40ac
Branch: refs/heads/master
Commit: 9f8a40acd5e9cb3dc3c7ff8d69b34c8b2b405909
Parents: cb02a32
Author: Daan Hoogland <dh...@schubergphilis.com>
Authored: Sun Apr 12 20:23:26 2015 +0200
Committer: Daan Hoogland <dh...@schubergphilis.com>
Committed: Sun Apr 12 20:23:26 2015 +0200
----------------------------------------------------------------------
.../com/cloud/network/bigswitch/BigSwitchBcfUtils.java | 8 ++++----
.../com/cloud/network/element/BigSwitchBcfElement.java | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f8a40ac/plugins/network-elements/bigswitch/src/com/cloud/network/bigswitch/BigSwitchBcfUtils.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch/src/com/cloud/network/bigswitch/BigSwitchBcfUtils.java b/plugins/network-elements/bigswitch/src/com/cloud/network/bigswitch/BigSwitchBcfUtils.java
index b6e3359..455535f 100644
--- a/plugins/network-elements/bigswitch/src/com/cloud/network/bigswitch/BigSwitchBcfUtils.java
+++ b/plugins/network-elements/bigswitch/src/com/cloud/network/bigswitch/BigSwitchBcfUtils.java
@@ -177,7 +177,7 @@ public class BigSwitchBcfUtils {
// handle external network first, only if NAT service is enabled
if(networks != null) {
- if(!(networks.isEmpty()) && isNatEnabled()!=null && isNatEnabled()){
+ if (!(networks.isEmpty()) && isNatEnabled()) {
// get public net info - needed to set up source nat gateway
NetworkVO pubNet = getPublicNetwork(physicalNetworkId);
@@ -440,7 +440,7 @@ public class BigSwitchBcfUtils {
public String syncTopologyToBcfHost(HostVO bigswitchBcfHost){
SyncBcfTopologyCommand syncCmd;
- if(isNatEnabled()!=null && isNatEnabled()){
+ if (isNatEnabled()) {
syncCmd = new SyncBcfTopologyCommand(true, true);
} else {
syncCmd = new SyncBcfTopologyCommand(true, false);
@@ -519,12 +519,12 @@ public class BigSwitchBcfUtils {
});
}
- public Boolean isNatEnabled(){
+ public boolean isNatEnabled() {
List<BigSwitchBcfDeviceVO> devices = _bigswitchBcfDao.listAll();
if(devices != null && !devices.isEmpty()){
return devices.get(0).getNat();
} else {
- return null;
+ return false;
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9f8a40ac/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java b/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java
index 2de447e..37391a6 100644
--- a/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java
+++ b/plugins/network-elements/bigswitch/src/com/cloud/network/element/BigSwitchBcfElement.java
@@ -30,25 +30,26 @@ import javax.ejb.Local;
import javax.inject.Inject;
import javax.naming.ConfigurationException;
+import org.apache.commons.net.util.SubnetUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
+
import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
-import org.apache.commons.net.util.SubnetUtils;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.BcfAnswer;
-import com.cloud.agent.api.UpdateBcfRouterCommand;
import com.cloud.agent.api.CreateBcfAttachmentCommand;
import com.cloud.agent.api.CreateBcfStaticNatCommand;
import com.cloud.agent.api.DeleteBcfAttachmentCommand;
import com.cloud.agent.api.DeleteBcfStaticNatCommand;
import com.cloud.agent.api.StartupBigSwitchBcfCommand;
import com.cloud.agent.api.StartupCommand;
+import com.cloud.agent.api.UpdateBcfRouterCommand;
import com.cloud.api.ApiDBUtils;
import com.cloud.api.commands.AddBigSwitchBcfDeviceCmd;
+import com.cloud.api.commands.BcfConstants;
import com.cloud.api.commands.DeleteBigSwitchBcfDeviceCmd;
import com.cloud.api.commands.ListBigSwitchBcfDevicesCmd;
-import com.cloud.api.commands.BcfConstants;
import com.cloud.api.response.BigSwitchBcfDeviceResponse;
import com.cloud.configuration.ConfigurationManager;
import com.cloud.dc.DataCenterVO;
@@ -451,8 +452,7 @@ NetworkACLServiceProvider, FirewallServiceProvider, ResourceStateAdapter {
zoneName = String.valueOf(zoneId);
}
- Boolean natNow = _bcfUtils.isNatEnabled();
- if( natNow != null)
+ boolean natNow = _bcfUtils.isNatEnabled();
if (!nat && natNow){
throw new CloudRuntimeException("NAT is enabled in existing controller. Enable NAT for new controller or remove existing controller first.");
} else if (nat && !natNow){