|
38 | 38 | import com.cloud.agent.api.Answer; |
39 | 39 | import com.cloud.agent.api.CheckHealthCommand; |
40 | 40 | import com.cloud.agent.api.CheckNetworkCommand; |
| 41 | +import com.cloud.agent.api.CheckOnHostCommand; |
41 | 42 | import com.cloud.agent.api.CheckVirtualMachineCommand; |
42 | 43 | import com.cloud.agent.api.CleanupNetworkRulesCmd; |
43 | 44 | import com.cloud.agent.api.Command; |
@@ -111,7 +112,7 @@ public int compare(final Object o1, final Object o2) { |
111 | 112 | public final static String[] s_commandsAllowedInMaintenanceMode = new String[] {MaintainCommand.class.toString(), MigrateCommand.class.toString(), |
112 | 113 | StopCommand.class.toString(), CheckVirtualMachineCommand.class.toString(), PingTestCommand.class.toString(), CheckHealthCommand.class.toString(), |
113 | 114 | ReadyCommand.class.toString(), ShutdownCommand.class.toString(), SetupCommand.class.toString(), |
114 | | - CleanupNetworkRulesCmd.class.toString(), CheckNetworkCommand.class.toString(), PvlanSetupCommand.class.toString()}; |
| 115 | + CleanupNetworkRulesCmd.class.toString(), CheckNetworkCommand.class.toString(), PvlanSetupCommand.class.toString(), CheckOnHostCommand.class.toString()}; |
115 | 116 | protected final static String[] s_commandsNotAllowedInConnectingMode = new String[] {StartCommand.class.toString(), CreateCommand.class.toString()}; |
116 | 117 | static { |
117 | 118 | Arrays.sort(s_commandsAllowedInMaintenanceMode); |
@@ -307,16 +308,18 @@ public boolean processAnswers(final long seq, final Response resp) { |
307 | 308 | } |
308 | 309 |
|
309 | 310 | protected void cancelAllCommands(final Status state, final boolean cancelActive) { |
310 | | - final Set<Map.Entry<Long, Listener>> entries = _waitForList.entrySet(); |
311 | | - final Iterator<Map.Entry<Long, Listener>> it = entries.iterator(); |
312 | | - while (it.hasNext()) { |
313 | | - final Map.Entry<Long, Listener> entry = it.next(); |
314 | | - it.remove(); |
315 | | - final Listener monitor = entry.getValue(); |
316 | | - if (s_logger.isDebugEnabled()) { |
317 | | - s_logger.debug(log(entry.getKey(), "Sending disconnect to " + monitor.getClass())); |
| 311 | + if (cancelActive) { |
| 312 | + final Set<Map.Entry<Long, Listener>> entries = _waitForList.entrySet(); |
| 313 | + final Iterator<Map.Entry<Long, Listener>> it = entries.iterator(); |
| 314 | + while (it.hasNext()) { |
| 315 | + final Map.Entry<Long, Listener> entry = it.next(); |
| 316 | + it.remove(); |
| 317 | + final Listener monitor = entry.getValue(); |
| 318 | + if (s_logger.isDebugEnabled()) { |
| 319 | + s_logger.debug(log(entry.getKey(), "Sending disconnect to " + monitor.getClass())); |
| 320 | + } |
| 321 | + monitor.processDisconnect(_id, state); |
318 | 322 | } |
319 | | - monitor.processDisconnect(_id, state); |
320 | 323 | } |
321 | 324 | } |
322 | 325 |
|
|
0 commit comments