CLOUDSTACK-5552 fixed private gateway DB clean up on failure

This commit is contained in:
Jayapal 2014-01-03 11:44:19 +05:30
parent 17b696e053
commit 77878299fb
2 changed files with 18 additions and 6 deletions

View File

@ -353,6 +353,9 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
s_logger.debug("Failed to apply network acl id " + gateway.getNetworkACLId() + " on gateway ");
return false;
}
} else {
s_logger.debug ("Failed to setup private gateway "+ gateway);
return false;
}
return true;
}
@ -413,10 +416,15 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
return true;
}
if (!_vpcRouterMgr.applyNetworkACLs(config, rules, routers, false)) {
throw new CloudRuntimeException("Failed to apply network acl rules in network " + config.getId());
} else {
return true;
try {
if (!_vpcRouterMgr.applyNetworkACLs(config, rules, routers, false)) {
return false;
} else {
return true;
}
} catch (Exception ex) {
s_logger.debug("Failed to apply network acl in network " + config.getId());
return false;
}
} else {
return true;

View File

@ -377,8 +377,12 @@ public class NetworkACLManagerImpl extends ManagerBase implements NetworkACLMana
throw new CloudRuntimeException("Failed to initialize vpc elements");
}
for (VpcProvider provider : vpcElements) {
return provider.applyACLItemsToPrivateGw(gateway, rules);
try{
for (VpcProvider provider : vpcElements) {
return provider.applyACLItemsToPrivateGw(gateway, rules);
}
} catch(Exception ex) {
s_logger.debug("Failed to apply acl to private gateway " + gateway);
}
return false;
}