vishesh92 commented on code in PR #10916:
URL: https://github.com/apache/cloudstack/pull/10916#discussion_r2106752911


##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -3483,6 +3483,8 @@ private Ternary<List<Long>, Integer, String[]> 
searchForDiskOfferingsIdsAndCount
                     diskOfferingSearch.and("displayOffering", 
diskOfferingSearch.entity().getDisplayOffering(), Op.EQ);
                 }
 
+                diskOfferingSearch.and("activeState", 
diskOfferingSearch.entity().getState(), Op.EQ);

Review Comment:
   @weizhouapache the state is never null. It was not working at all earlier 
because we were setting `activeState` which hasn't been defined in the search 
builder.
   
   Below is the getState method from listDiskOfferingsCmd. 
   ```
       public State getState() {
           if (StringUtils.isBlank(diskOfferingState)) {
               return Active;
           }
           State state = EnumUtils.getEnumIgnoreCase(State.class, 
diskOfferingState);
           if (!diskOfferingState.equalsIgnoreCase("all") && state == null) {
               throw new IllegalArgumentException("Invalid state value: " + 
diskOfferingState);
           }
           return state;
       }
   
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to