sgoeminn commented on a change in pull request #2250: CLOUDSTACK-10057:
listNetworkOfferings now returns the correct number of offerings.
URL: https://github.com/apache/cloudstack/pull/2250#discussion_r136758681
##########
File path: server/src/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -4788,7 +4788,7 @@ protected void validateNtwkOffDetails(final Map<Detail,
String> details, final M
// Now apply pagination
final List<? extends NetworkOffering> wPagination =
StringUtils.applyPagination(supportedOfferings, cmd.getStartIndex(),
cmd.getPageSizeVal());
if (wPagination != null) {
- final Pair<List<? extends NetworkOffering>, Integer>
listWPagination = new Pair<List<? extends NetworkOffering>,
Integer>(wPagination, offerings.size());
+ final Pair<List<? extends NetworkOffering>, Integer>
listWPagination = new Pair<List<? extends NetworkOffering>,
Integer>(wPagination, supportedOfferings.size());
Review comment:
Line 4798 is correct. The supportedOfferings list is build/created within
the ` if (parseOfferings)` code block. In the else case we want to return the
offerings list and the size of the offerings list (supportedOfferings is also
not defined in that case).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services