Clean up restart Network

This commit is contained in:
Sheng Yang 2011-08-10 15:02:08 -07:00
parent bcf5058eda
commit 18f2df44a1
2 changed files with 13 additions and 3 deletions

View File

@ -2408,13 +2408,23 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
s_logger.debug("Restarting network elements for the network " + network);
for (NetworkElement element : _networkElements) {
// stop and start the network element
if (!element.restart(network, context)) {
s_logger.warn("Failed to restart network element(s) as a part of network id" + networkId + " restart");
try {
boolean supported = element.restart(network, context);
if (!supported) {
s_logger.trace("Network element(s) " + element.getName() + " doesn't support network id" + networkId + " restart");
}
} catch (Exception ex) {
s_logger.warn("Failed to restart network element" + element.getName() + " as a part of network id" + networkId + " restart", ex);
success = false;
}
}
}
if (!success) {
return false;
}
// associate all ip addresses
if (!applyIpAssociations(network, false)) {
s_logger.warn("Failed to apply ip addresses as a part of network id" + networkId + " restart");

View File

@ -152,7 +152,7 @@ public class VirtualRouterElement extends DhcpElement implements NetworkElement,
long host_id = 0;
for (DomainRouterVO router : routers) {
host_id = router.getHostId();
/* TODO it's not completely safe to ignore these failure, but we would try to push on now */
/* FIXME it's not completely safe to ignore these failure, but we would try to push on now */
if (_routerMgr.stopRouter(router.getId(), false) == null) {
s_logger.warn("Failed to stop virtual router element " + router + " as a part of network " + network + " restart");
}