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 2021/03/15 16:27:45 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4789: api/server: fix hahost value in listHosts

DaanHoogland commented on a change in pull request #4789:
URL: https://github.com/apache/cloudstack/pull/4789#discussion_r594490067



##########
File path: server/src/main/java/com/cloud/api/query/dao/HostJoinDaoImpl.java
##########
@@ -274,12 +269,19 @@ public HostResponse newHostResponse(HostJoinVO host, EnumSet<HostDetails> detail
     @Override
     public HostResponse setHostResponse(HostResponse response, HostJoinVO host) {
         String tag = host.getTag();
-        if (tag != null) {
-            if (response.getHostTags() != null && response.getHostTags().length() > 0) {
+        if (StringUtils.isNotEmpty(tag)) {
+            if (StringUtils.isNotEmpty(response.getHostTags())) {
                 response.setHostTags(response.getHostTags() + "," + tag);
             } else {
                 response.setHostTags(tag);
             }
+
+            if (!Boolean.TRUE.equals(response.getHaHost())) {

Review comment:
       my choice would be
   ```suggestion
               if (Boolean.FALSE.equals(response.getHaHost())) {
   ```
   @shwstppr can you answer @GutoVeronezi ?




----------------------------------------------------------------
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