[
https://issues.apache.org/jira/browse/CLOUDSTACK-8855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16311533#comment-16311533
]
ASF GitHub Bot commented on CLOUDSTACK-8855:
--------------------------------------------
rafaelweingartner 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_r159683766
##########
File path:
engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
##########
@@ -994,33 +980,29 @@ public Answer easySend(final Long hostId, final Command
cmd) {
}
@Override
- public boolean reconnect(final long hostId) {
- HostVO host;
+ public void reconnect(final long hostId) throws AgentUnavailableException {
+ HostVO host = _hostDao.findById(hostId);
+ if (host == null) {
+ throw new CloudRuntimeException("Unable to find host: " + hostId);
+ }
- host = _hostDao.findById(hostId);
- if (host == null || host.getRemoved() != null) {
- s_logger.warn("Unable to find host " + hostId);
- return false;
+ if (host.getRemoved() != null) {
+ throw new CloudRuntimeException("Host has already been removed: "
+ hostId);
}
if (host.getStatus() == Status.Disconnected) {
- s_logger.info("Host is already disconnected, no work to be done");
- return true;
+ s_logger.debug("Host is already disconnected, no work to be done:
" + hostId);
Review comment:
@DaanHoogland I made a mistake here. Can you fix it for me?
You need to add a `return;`, right after line 994
----------------------------------------------------------------
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]
> 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.4.14#64029)