|
16 | 16 | // under the License. |
17 | 17 | package org.apache.cloudstack.engine.orchestration; |
18 | 18 |
|
| 19 | +import static com.cloud.configuration.ConfigurationManager.MESSAGE_DELETE_VLAN_IP_RANGE_EVENT; |
| 20 | + |
19 | 21 | import java.net.URI; |
20 | 22 | import java.util.ArrayList; |
21 | 23 | import java.util.Arrays; |
|
241 | 243 | import com.cloud.vm.UserVmVO; |
242 | 244 | import com.cloud.vm.VMInstanceVO; |
243 | 245 | import com.cloud.vm.VirtualMachine; |
244 | | -import com.cloud.vm.VirtualMachineManager; |
245 | 246 | import com.cloud.vm.VirtualMachine.Type; |
| 247 | +import com.cloud.vm.VirtualMachineManager; |
246 | 248 | import com.cloud.vm.VirtualMachineProfile; |
247 | 249 | import com.cloud.vm.dao.DomainRouterDao; |
248 | 250 | import com.cloud.vm.dao.NicDao; |
|
255 | 257 | import com.cloud.vm.dao.VMInstanceDao; |
256 | 258 | import com.googlecode.ipv6.IPv6Address; |
257 | 259 |
|
258 | | -import static com.cloud.configuration.ConfigurationManager.MESSAGE_DELETE_VLAN_IP_RANGE_EVENT; |
259 | | - |
260 | 260 | /** |
261 | 261 | * NetworkManagerImpl implements NetworkManager. |
262 | 262 | */ |
@@ -1339,20 +1339,6 @@ protected NicTO toNicTO(final NicVO nic, final NicProfile profile, final Network |
1339 | 1339 | return to; |
1340 | 1340 | } |
1341 | 1341 |
|
1342 | | - boolean isNetworkImplemented(final NetworkVO network) { |
1343 | | - final Network.State state = network.getState(); |
1344 | | - final NetworkOfferingVO offeringVO = _networkOfferingDao.findById(network.getNetworkOfferingId()); |
1345 | | - if (state == Network.State.Implemented) { |
1346 | | - return true; |
1347 | | - } else if (state == Network.State.Setup) { |
1348 | | - final DataCenterVO zone = _dcDao.findById(network.getDataCenterId()); |
1349 | | - if ((!isSharedNetworkOfferingWithServices(network.getNetworkOfferingId()) && !offeringVO.isPersistent()) || zone.getNetworkType() == NetworkType.Basic) { |
1350 | | - return true; |
1351 | | - } |
1352 | | - } |
1353 | | - return false; |
1354 | | - } |
1355 | | - |
1356 | 1342 | Pair<NetworkGuru, NetworkVO> implementNetwork(final long networkId, final DeployDestination dest, final ReservationContext context, final boolean isRouter) throws ConcurrentOperationException, |
1357 | 1343 | ResourceUnavailableException, InsufficientCapacityException { |
1358 | 1344 | Pair<NetworkGuru, NetworkVO> implemented = null; |
@@ -1450,6 +1436,20 @@ private boolean networkMeetsPersistenceCriteria(NetworkVO network, NetworkOfferi |
1450 | 1436 | } |
1451 | 1437 | } |
1452 | 1438 |
|
| 1439 | + @Override |
| 1440 | + public boolean isNetworkImplemented(final Network network) { |
| 1441 | + final Network.State state = network.getState(); |
| 1442 | + final NetworkOfferingVO offeringVO = _networkOfferingDao.findById(network.getNetworkOfferingId()); |
| 1443 | + if (state == Network.State.Implemented) { |
| 1444 | + return true; |
| 1445 | + } else if (state == Network.State.Setup) { |
| 1446 | + final DataCenterVO zone = _dcDao.findById(network.getDataCenterId()); |
| 1447 | + return (!isSharedNetworkOfferingWithServices(network.getNetworkOfferingId()) && !offeringVO.isPersistent()) |
| 1448 | + || zone.getNetworkType() == NetworkType.Basic; |
| 1449 | + } |
| 1450 | + return false; |
| 1451 | + } |
| 1452 | + |
1453 | 1453 | @Override |
1454 | 1454 | @DB |
1455 | 1455 | public Pair<NetworkGuru, NetworkVO> implementNetwork(final long networkId, final DeployDestination dest, final ReservationContext context) throws ConcurrentOperationException, |
|
0 commit comments