You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by bvbharatk <gi...@git.apache.org> on 2016/04/21 07:52:59 UTC

[GitHub] cloudstack pull request: CLOUDSTACK-8855 Improve Error Message for...

Github user bvbharatk commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/837#discussion_r60529246
  
    --- Diff: engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java ---
    @@ -971,33 +971,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");
             }
     
             if (host.getStatus() != Status.Up && host.getStatus() != Status.Alert && host.getStatus() != Status.Rebalancing) {
    -            s_logger.info("Unable to disconnect host because it is not in the correct state: host=" + hostId + "; Status=" + host.getStatus());
    -            return false;
    +            throw  new CloudRuntimeException("Unable to disconnect host because it is not in the correct state: host=" + hostId + "; Status=" + host.getStatus());
             }
     
             final AgentAttache attache = findAttache(hostId);
             if (attache == null) {
    -            s_logger.info("Unable to disconnect host because it is not connected to this server: " + hostId);
    -            return false;
    +            throw new CloudRuntimeException("Unable to disconnect host because it is not connected to this server: " + hostId);
             }
     
             disconnectWithoutInvestigation(attache, Event.ShutdownRequested);
    -        return true;
         }
     
         public boolean executeUserRequest(final long hostId, final Event event) throws AgentUnavailableException {
    --- End diff --
    
    @rodrigo93 
    This method is already a void. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---