cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-8855) Improve Error Message for Host Alert State
Date Sat, 06 Feb 2016 01:12:39 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-8855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15135395#comment-15135395
] 

ASF GitHub Bot commented on CLOUDSTACK-8855:
--------------------------------------------

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

    https://github.com/apache/cloudstack/pull/837#discussion_r52093680
  
    --- 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 --
    
    Couldn't this method be void as well and throw an exception if the execution fails?


> Improve Error Message for Host Alert State
> ------------------------------------------
>
>                 Key: CLOUDSTACK-8855
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8855
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>    Affects Versions: 4.6.0
>            Reporter: Bharat Kumar
>            Assignee: Bharat Kumar
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message