marcaurele commented on a change in pull request #2380: CLOUDSTACK-8855 Improve 
Error Message for Host Alert State and reconnect host API.
URL: https://github.com/apache/cloudstack/pull/2380#discussion_r159676070
 
 

 ##########
 File path: 
engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
 ##########
 @@ -994,33 +994,28 @@ public Answer easySend(final Long hostId, final Command 
cmd) {
     }
 
     @Override
-    public boolean reconnect(final long hostId) {
+    public void reconnect(final long hostId) throws CloudRuntimeException, 
AgentUnavailableException{
         HostVO host;
 
         host = _hostDao.findById(hostId);
         if (host == null || host.getRemoved() != null) {
-            s_logger.warn("Unable to find host " + hostId);
-            return false;
+            throw new CloudRuntimeException("Unable to find host " + hostId);
         }
 
         if (host.getStatus() == Status.Disconnected) {
-            s_logger.info("Host is already disconnected, no work to be done");
-            return true;
+            throw new CloudRuntimeException("Host is already disconnected, no 
work to be done");
 
 Review comment:
   This looks wrong to me, why throwing an exception when nothing has to be 
done?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to