cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yas...@apache.org
Subject git commit: updated refs/heads/master to d920210
Date Mon, 05 Aug 2013 18:23:13 GMT
Updated Branches:
  refs/heads/master 84ed1fee6 -> d9202100e


fix warnings in NetworkServiceImpl: removed unused code and add cases to switches


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d9202100
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d9202100
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d9202100

Branch: refs/heads/master
Commit: d9202100e028f9b3db9646e79d9a894ab238f529
Parents: 84ed1fe
Author: Daan Hoogland <daan@onecht.net>
Authored: Sat Aug 3 11:46:35 2013 +0200
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Mon Aug 5 11:21:39 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/network/NetworkServiceImpl.java | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d9202100/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index ff753f4..39663e1 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -548,7 +548,7 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
         long callerUserId = CallContext.current().getCallingUserId();
         DataCenter zone = _configMgr.getZone(zoneId);
 
-        if ((networkId == null && vpcId == null) && (networkId != null &&
vpcId != null)) {
+        if ((networkId == null && vpcId == null) || (networkId != null &&
vpcId != null)) {
             throw new InvalidParameterValueException("One of Network id or VPC is should
be passed");
         }
 
@@ -652,7 +652,6 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
             throw new InvalidParameterValueException("The nic is not belongs to user vm");
         }
 
-        Nic nic = _nicDao.findById(nicId);
         VirtualMachine vm = _userVmDao.findById(nicVO.getInstanceId());
         if (vm == null) {
             throw new InvalidParameterValueException("There is no vm with the nic");
@@ -672,7 +671,6 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
         NetworkOfferingVO ntwkOff = _networkOfferingDao.findById(network.getNetworkOfferingId());
 
         DataCenter dc = _dcDao.findById(network.getDataCenterId());
-        Long id = nicVO.getInstanceId();
 
         DataCenter zone = _configMgr.getZone(zoneId);
         if (zone == null) {
@@ -3336,12 +3334,8 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
         boolean update = false;
 
         if (state != null) {
-            if (state == PhysicalNetworkServiceProvider.State.Shutdown) {
-                throw new InvalidParameterValueException("Updating the provider state to
'Shutdown' is not supported");
-            }
-
             if (s_logger.isDebugEnabled()) {
-                s_logger.debug("updating state of the service provider id=" + id + " on physical
network: " + provider.getPhysicalNetworkId() + " to state: " + stateStr);
+                s_logger.debug("trying to update the state of the service provider id=" +
id + " on physical network: " + provider.getPhysicalNetworkId() + " to state: " + stateStr);
             }
             switch (state) {
             case Enabled:
@@ -3357,6 +3351,8 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
                 provider.setState(PhysicalNetworkServiceProvider.State.Disabled);
                 update = true;
                 break;
+            case Shutdown:
+                throw new  InvalidParameterValueException("Updating the provider state to
'Shutdown' is not supported");
             }
         }
 
@@ -3564,6 +3560,9 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService
{
         case Control:
             xenLabel = "cloud_link_local_network";
             break;
+        case Vpn:
+        case None:
+            break;
         }
         return xenLabel;
     }


Mime
View raw message