You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ya...@apache.org on 2013/08/05 20:33:57 UTC
git commit: updated refs/heads/4.2 to ff803f4
Updated Branches:
refs/heads/4.2 0f539b4ce -> ff803f413
fix warnings in NetworkServiceImpl: removed unused code and add cases to switches
Signed-off-by: Sheng Yang <sh...@citrix.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ff803f41
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ff803f41
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ff803f41
Branch: refs/heads/4.2
Commit: ff803f4131d6fe170004608da272b88f5a991202
Parents: 0f539b4
Author: Daan Hoogland <da...@onecht.net>
Authored: Sat Aug 3 11:46:35 2013 +0200
Committer: Sheng Yang <sh...@citrix.com>
Committed: Mon Aug 5 11:33:50 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/ff803f41/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 739f5cc..304cefa 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -547,7 +547,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
long callerUserId = UserContext.current().getCallerUserId();
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");
}
@@ -651,7 +651,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");
@@ -671,7 +670,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) {
@@ -3337,12 +3335,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:
@@ -3358,6 +3352,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");
}
}
@@ -3565,6 +3561,9 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
case Control:
xenLabel = "cloud_link_local_network";
break;
+ case Vpn:
+ case None:
+ break;
}
return xenLabel;
}