-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDSTACK-10057: listNetworkOfferings now returns the correct number of offerings. #2250
Conversation
@blueorangutan package |
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1057 |
@blueorangutan test |
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
Trillian test result (tid-1475)
|
@@ -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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional review and testing requested, if we need to change this line, then 4798 may have similar code as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgoeminn why not use wPagination.size()
, or is it that you want to expose the count value equal to total found/supported offerings however only return the offerings in the current page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhtyd we always want to return the number of total found offerings and not only the number of offerings in the page that is returned. This is the same behavior as all the other list cmds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgoeminn thanks.
8ff721f
to
96c6241
Compare
@blueorangutan package |
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1138 |
@blueorangutan test |
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
Trillian test result (tid-1568)
|
I've added an extra unit test for the changed code, to keep the history intact in relation to the Trillian Tests, I have not squashed yet. I will squash once we have approval. |
@blueorangutan package |
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1154 |
@@ -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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f5213fc
to
9a0ec3e
Compare
@rhtyd Do you agree to merge this? I have squashed both commits, but somehow Jenkins fails to report back its state, and the build is gone (hooray for only keeping 5 PR builds). |
9a0ec3e
to
8016a91
Compare
LGTM, sure @fmaximus @krissterckx we can merge this. |
https://issues.apache.org/jira/browse/CLOUDSTACK-10057