Pearl1594 commented on code in PR #14166:
URL: https://github.com/apache/cloudstack/pull/14166#discussion_r4670299619
##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -1304,6 +1308,25 @@ private Object getObjectPossibleMethodValue(Object obj,
String methodName) {
return result;
}
+ SearchBuilder<NicVO> createNicSearchBuilder(Long vpcId, boolean
hasAssociatedNics) {
+ SearchBuilder<NicVO> nicSearch = nicDao.createSearchBuilder();
+ if (hasAssociatedNics) {
+ // trunk nics list networkId as an association, not as their
primary network
+ nicSearch.and().op("networkId", nicSearch.entity().getNetworkId(),
Op.EQ);
+ nicSearch.or("associatedNicIdIN", nicSearch.entity().getId(),
Op.IN);
+ nicSearch.cp();
+ } else {
+ nicSearch.and("networkId", nicSearch.entity().getNetworkId(),
Op.EQ);
+ }
+ nicSearch.and("removed", nicSearch.entity().getRemoved(), Op.NULL);
+ if (vpcId != null) {
+ SearchBuilder<NetworkVO> networkSearch =
networkDao.createSearchBuilder();
+ networkSearch.and("vpcId", networkSearch.entity().getVpcId(),
Op.EQ);
+ nicSearch.join("vpc", networkSearch,
networkSearch.entity().getId(), nicSearch.entity().getNetworkId(),
JoinBuilder.JoinType.INNER);
Review Comment:
Addressed in #14803
--
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]