Skip to content

Commit 550493c

Browse files
sedukullDaanHoogland
authored andcommitted
Added fix for CLOUDSTACK-6548
Signed-off-by: santhosh <santhosh.edukulla@gmail.com> Signed-off-by: Daan Hoogland <daan@onecht.net>
1 parent cc0ed93 commit 550493c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎server/src/com/cloud/network/NetworkServiceImpl.java‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3968,12 +3968,16 @@ public Network doInTransaction(TransactionStatus status) throws ResourceAllocati
39683968
DataCenterVO dc = _dcDao.lockRow(pNtwk.getDataCenterId(), true);
39693969

39703970
//check if we need to create guest network
3971-
Network privateNetwork = _networksDao.getPrivateNetwork(uriString, cidr, networkOwnerId, pNtwk.getDataCenterId(), networkOfferingId);
3971+
Network privateNetwork = _networksDao.getPrivateNetwork(uriString, cidr, networkOwnerId, pNtwk.getDataCenterId(), networkOfferingId);
39723972
if (privateNetwork == null) {
39733973
//create Guest network
3974-
privateNetwork = _networkMgr.createGuestNetwork(ntwkOffFinal.getId(), networkName, displayText, gateway, cidr, uriString, null, owner, null, pNtwk,
3974+
privateNetwork = _networkMgr.createGuestNetwork(ntwkOffFinal.getId(), networkName, displayText, gateway, cidr, uriString, null, owner, null, pNtwk,
39753975
pNtwk.getDataCenterId(), ACLType.Account, null, vpcId, null, null, true, null);
3976-
s_logger.debug("Created private network " + privateNetwork);
3976+
if (privateNetwork != null) {
3977+
s_logger.debug("Successfully created guest network " + privateNetwork);
3978+
} else {
3979+
throw new CloudRuntimeException("Creating guest network failed");
3980+
}
39773981
} else {
39783982
s_logger.debug("Private network already exists: " + privateNetwork);
39793983
//Do not allow multiple private gateways with same Vlan within a VPC

0 commit comments

Comments
 (0)