cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [2/7] git commit: updated refs/heads/master to c31e8e7
Date Thu, 05 Feb 2015 11:52:43 GMT
AgentAttache: allow checkonhost command in maintenance, cancel if only allowed

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/61dfb2d6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/61dfb2d6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/61dfb2d6

Branch: refs/heads/master
Commit: 61dfb2d625ede1d5ce38450bd4ddbdb2a1129b91
Parents: 0afec01
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Thu Feb 5 16:29:03 2015 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu Feb 5 16:29:03 2015 +0530

----------------------------------------------------------------------
 .../com/cloud/agent/manager/AgentAttache.java   | 23 +++++++++++---------
 1 file changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/61dfb2d6/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
index 0f02792..0acac3c 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java
@@ -38,6 +38,7 @@ import com.cloud.agent.Listener;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.CheckHealthCommand;
 import com.cloud.agent.api.CheckNetworkCommand;
+import com.cloud.agent.api.CheckOnHostCommand;
 import com.cloud.agent.api.CheckVirtualMachineCommand;
 import com.cloud.agent.api.CleanupNetworkRulesCmd;
 import com.cloud.agent.api.Command;
@@ -111,7 +112,7 @@ public abstract class AgentAttache {
     public final static String[] s_commandsAllowedInMaintenanceMode = new String[] {MaintainCommand.class.toString(),
MigrateCommand.class.toString(),
         StopCommand.class.toString(), CheckVirtualMachineCommand.class.toString(), PingTestCommand.class.toString(),
CheckHealthCommand.class.toString(),
         ReadyCommand.class.toString(), ShutdownCommand.class.toString(), SetupCommand.class.toString(),
-        CleanupNetworkRulesCmd.class.toString(), CheckNetworkCommand.class.toString(), PvlanSetupCommand.class.toString()};
+        CleanupNetworkRulesCmd.class.toString(), CheckNetworkCommand.class.toString(), PvlanSetupCommand.class.toString(),
CheckOnHostCommand.class.toString()};
     protected final static String[] s_commandsNotAllowedInConnectingMode = new String[] {StartCommand.class.toString(),
CreateCommand.class.toString()};
     static {
         Arrays.sort(s_commandsAllowedInMaintenanceMode);
@@ -307,16 +308,18 @@ public abstract class AgentAttache {
     }
 
     protected void cancelAllCommands(final Status state, final boolean cancelActive) {
-        final Set<Map.Entry<Long, Listener>> entries = _waitForList.entrySet();
-        final Iterator<Map.Entry<Long, Listener>> it = entries.iterator();
-        while (it.hasNext()) {
-            final Map.Entry<Long, Listener> entry = it.next();
-            it.remove();
-            final Listener monitor = entry.getValue();
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug(log(entry.getKey(), "Sending disconnect to " + monitor.getClass()));
+        if (cancelActive) {
+            final Set<Map.Entry<Long, Listener>> entries = _waitForList.entrySet();
+            final Iterator<Map.Entry<Long, Listener>> it = entries.iterator();
+            while (it.hasNext()) {
+                final Map.Entry<Long, Listener> entry = it.next();
+                it.remove();
+                final Listener monitor = entry.getValue();
+                if (s_logger.isDebugEnabled()) {
+                    s_logger.debug(log(entry.getKey(), "Sending disconnect to " + monitor.getClass()));
+                }
+                monitor.processDisconnect(_id, state);
             }
-            monitor.processDisconnect(_id, state);
         }
     }
 


Mime
View raw message