You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "harikrishna-patnala (via GitHub)" <gi...@apache.org> on 2023/03/27 05:39:41 UTC

[GitHub] [cloudstack] harikrishna-patnala commented on a diff in pull request #7368: UI: Add filtering by state in systemvms, router and storagepool

harikrishna-patnala commented on code in PR #7368:
URL: https://github.com/apache/cloudstack/pull/7368#discussion_r1148805763


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -2607,6 +2608,14 @@ private Pair<List<StoragePoolJoinVO>, Integer> searchForStoragePoolsInternal(Lis
                 throw new InvalidParameterValueException("Invalid scope type: " + cmd.getScope());
             }
         }
+        StoragePoolStatus state = null;
+        if (cmd.getState() != null && EnumUtils.isValidEnumIgnoreCase(StoragePoolStatus.class, cmd.getState())) {

Review Comment:
   I think with this flow, state will be skipped if invalid value is passed, it won't enter catch since we are validating before getting the value.
   How about validating the value and throw exception if it is invalid (before getEnumIgnoreCase) !



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

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

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