DaanHoogland commented on code in PR #6851:
URL: https://github.com/apache/cloudstack/pull/6851#discussion_r1045029697
##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -971,6 +972,17 @@ public ListResponse<UserVmResponse>
searchForUserVMs(ListVMsCmd cmd) {
return response;
}
+ private Object getObjectPossibleMethodValue(Object obj, String methodName)
{
+ Object result = null;
+
+ try {
+ Method m = obj.getClass().getMethod(methodName);
+ result = m.invoke(obj);
+ } catch (NoSuchMethodException | InvocationTargetException |
IllegalAccessException ignored) {}
Review Comment:
i was thinking that as well, but didn´t want to change to much anymore. We
will hit this for sure in the current state if ListVMsCmd is called in the API.
It will try to add the attributes that don´t exist and we are supposed to
ignore those.
```suggestion
} catch (NoSuchMethodException | InvocationTargetException |
IllegalAccessException ignored) {/*ignored when non-ByAdmin are calling this.*/}
```
--
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]