Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Re-implements image listing to sort/filter on jumpgate itself #146

Merged
merged 1 commit into from Aug 7, 2014
Merged

Re-implements image listing to sort/filter on jumpgate itself #146

merged 1 commit into from Aug 7, 2014

Conversation

sudorandom
Copy link
Contributor

This should fix the issue with specifying a marker when listing images not working properly. This solution is not optimal since it sorts and filters client side.

output.append(formatted_image)
if limit is not None:
limit -= 1
sorted_images = sorted_images[:int(req.get_param('limit'))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if limit was None here? Now normally, does not make sense to pass marker parameter without a limit parameter but probably need a default here inside this array subset specification. I.e.
sorted_images = sorted_images[:int(req.get_param('limit') or "20")]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to read in this diff, but the list is not limited at all if limit isn't passed:

if req.get_param('limit'):
    sorted_images = sorted_images[:int(req.get_param('limit'))]

But yeah, having a default limit might be good

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, missed the hidden line 158 in all the diff-deletes. This should be fine for now.

@jimlindeman
Copy link
Contributor

+1
Looks good

jimlindeman added a commit that referenced this pull request Aug 7, 2014
Re-implements image listing to sort/filter on jumpgate itself
@jimlindeman jimlindeman merged commit 0c12f4b into softlayer:master Aug 7, 2014
@sudorandom sudorandom deleted the image-list branch August 7, 2014 19:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants