Skip to content

Commit 70daee9

Browse files
raveningDaanHoogland
authored andcommitted
network: set restart_required to 0 after restarting network (#3803)
After restarting the network with or without cleanup option, the restart_required field in networks table should be reset to 0.
1 parent a718746 commit 70daee9

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,7 +2936,8 @@ public boolean startNetwork(final long networkId, final DeployDestination dest,
29362936
@Override
29372937
public boolean restartNetwork(final Long networkId, final Account callerAccount, final User callerUser, final boolean cleanup) throws ConcurrentOperationException, ResourceUnavailableException,
29382938
InsufficientCapacityException {
2939-
2939+
boolean status = true;
2940+
boolean restartRequired = false;
29402941
final NetworkVO network = _networksDao.findById(networkId);
29412942

29422943
s_logger.debug("Restarting network " + networkId + "...");
@@ -2947,16 +2948,17 @@ public boolean restartNetwork(final Long networkId, final Account callerAccount,
29472948

29482949
if (cleanup) {
29492950
if (!rollingRestartRouters(network, offering, dest, context)) {
2950-
setRestartRequired(network, true);
2951-
return false;
2951+
status = false;
2952+
restartRequired = true;
29522953
}
2953-
return true;
2954+
setRestartRequired(network, restartRequired);
2955+
return status;
29542956
}
29552957

29562958
s_logger.debug("Implementing the network " + network + " elements and resources as a part of network restart without cleanup");
29572959
try {
29582960
implementNetworkElementsAndResources(dest, context, network, offering);
2959-
setRestartRequired(network, true);
2961+
setRestartRequired(network, false);
29602962
return true;
29612963
} catch (final Exception ex) {
29622964
s_logger.warn("Failed to implement network " + network + " elements and resources as a part of network restart due to ", ex);

0 commit comments

Comments
 (0)