VPC: don't generate empty SetStaticRoute command during VR start when there are no static routes for the VPC

This commit is contained in:
Alena Prokharchyk 2012-06-27 10:31:15 -07:00
parent c3213a4735
commit e2fd2f7515
2 changed files with 11 additions and 9 deletions

View File

@ -814,7 +814,9 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
s_logger.debug("Found " + staticRouteProfiles.size() + " static routes to apply as a part of vpc route "
+ router + " start");
createStaticRouteCommands(staticRouteProfiles, router, cmds);
if (!staticRouteProfiles.isEmpty()) {
createStaticRouteCommands(staticRouteProfiles, router, cmds);
}
//4) REPROGRAM GUEST NETWORK
boolean reprogramGuestNtwks = true;

View File

@ -594,16 +594,16 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
}
if (vpcsDeleted) {
// release ip addresses belonging to the account
List<? extends IpAddress> ipsToRelease = _ipAddressDao.listByAccount(accountId);
for (IpAddress ip : ipsToRelease) {
s_logger.debug("Releasing ip " + ip + " as a part of account id=" + accountId + " cleanup");
if (!_networkMgr.disassociatePublicIpAddress(ip.getId(), callerUserId, caller)) {
s_logger.warn("Failed to release ip address " + ip + " as a part of account id=" + accountId + " clenaup");
accountCleanupNeeded = true;
// release ip addresses belonging to the account
List<? extends IpAddress> ipsToRelease = _ipAddressDao.listByAccount(accountId);
for (IpAddress ip : ipsToRelease) {
s_logger.debug("Releasing ip " + ip + " as a part of account id=" + accountId + " cleanup");
if (!_networkMgr.disassociatePublicIpAddress(ip.getId(), callerUserId, caller)) {
s_logger.warn("Failed to release ip address " + ip + " as a part of account id=" + accountId + " clenaup");
accountCleanupNeeded = true;
}
}
}
}
// delete account specific Virtual vlans (belong to system Public Network) - only when networks are cleaned
// up successfully