You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/08/03 13:04:24 UTC

[GitHub] [cloudstack] ravening commented on a change in pull request #4228: Dont add host back after agent service restart

ravening commented on a change in pull request #4228:
URL: https://github.com/apache/cloudstack/pull/4228#discussion_r464399196



##########
File path: server/src/main/java/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
##########
@@ -348,11 +362,19 @@ private void setupAgentSecurity(final Connection sshConnection, final String age
             _hostDao.saveDetails(connectedHost);
             return resources;
         } catch (DiscoveredWithErrorException e) {
+            s_logger.error("Exception: "+ e.getMessage());
             throw e;
         } catch (Exception e) {
             String msg = " can't setup agent, due to " + e.toString() + " - " + e.getMessage();
             s_logger.warn(msg);
         } finally {
+            // set guid to null once host is added

Review comment:
       @DaanHoogland this code is executed only for the newly added hosts. When the host is removed previously, the guid is set to null. So the initial value of `guid` will always be `null` in this case.
   Before adding the host, I set the guid to a temporary value and at the end I set it back to null which is the original value.
   I hope to have cleared your confusion




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org