You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ek...@apache.org on 2015/06/29 10:43:52 UTC

[14/15] git commit: updated refs/heads/master to 527d6ee

In case we cannot update the password of all hosts in a cluster, please stop and notify the user about the failure.

   - The host id that failed to get updated will be informed in the error.

Signed-off-by: wilderrodrigues <wr...@schubergphilis.com>


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

Branch: refs/heads/master
Commit: 284e2d68e1c076ff990e5cd8472fb2240d57117f
Parents: ea9db19
Author: wilderrodrigues <wr...@schubergphilis.com>
Authored: Thu Jun 25 11:14:31 2015 +0200
Committer: wilderrodrigues <wr...@schubergphilis.com>
Committed: Mon Jun 29 09:59:11 2015 +0200

----------------------------------------------------------------------
 server/src/com/cloud/resource/ResourceManagerImpl.java | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/284e2d68/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 53a6b19..5e6322e 100644
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -2234,28 +2234,31 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
         nv = _hostDetailsDao.findDetail(hostId, ApiConstants.PASSWORD);
         final String password = nv.getValue();
         final UpdateHostPasswordCommand cmd = new UpdateHostPasswordCommand(username, password);
-        _agentMgr.easySend(hostId, cmd);
-        return true;
+        final Answer answer = _agentMgr.easySend(hostId, cmd);
+        return answer != null;
     }
 
     @Override
     public boolean updateClusterPassword(final UpdateHostPasswordCmd command) {
         // get agents for the cluster
         final List<HostVO> hosts = listAllHostsInCluster(command.getClusterId());
-        for (final HostVO h : hosts) {
+        for (final HostVO host : hosts) {
             try {
                 /*
                  * FIXME: this is a buggy logic, check with alex. Shouldn't
                  * return if propagation return non null
                  */
-                final Boolean result = propagateResourceEvent(h.getId(), ResourceState.Event.UpdatePassword);
+                final Boolean result = propagateResourceEvent(host.getId(), ResourceState.Event.UpdatePassword);
                 if (result != null) {
                     return result;
                 }
             } catch (final AgentUnavailableException e) {
                 s_logger.error("Agent is not availbale!", e);
             }
-            doUpdateHostPassword(h.getId());
+            final boolean isUpdated = doUpdateHostPassword(host.getId());
+            if (!isUpdated) {
+                throw new CloudRuntimeException("CloudStack failed to update the password of the Host with ID ==> " + host.getId() + ". Please make sure you are still able to connect to your hosts.");
+            }
         }
 
         return true;