From e2fd2f751565e0897873567e9fe5427bd2cd37be Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 27 Jun 2012 10:31:15 -0700 Subject: [PATCH] VPC: don't generate empty SetStaticRoute command during VR start when there are no static routes for the VPC --- .../VpcVirtualNetworkApplianceManagerImpl.java | 4 +++- .../src/com/cloud/user/AccountManagerImpl.java | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java index e88d529ea18..cc87960ff89 100644 --- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java @@ -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; diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index 75c0cf6d044..fc26dd8e0d7 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -594,16 +594,16 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag } if (vpcsDeleted) { - // release ip addresses belonging to the account - List 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 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