cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject [14/15] git commit: updated refs/heads/master to 527d6ee
Date Mon, 29 Jun 2015 08:43:52 GMT
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 <wrodrigues@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 <wrodrigues@schubergphilis.com>
Authored: Thu Jun 25 11:14:31 2015 +0200
Committer: wilderrodrigues <wrodrigues@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;


Mime
View raw message