get volumes API does not handle limit=0
This bug fixes a regression from bug
1288429, where the "next"
link is added when the number of volumes returned is the
maximum limit (even if the "limit" param is not specified).
The regression is hit when a "limit" of 0 is specified; in this
case the logic to create the "next" link is still executed and an
exception is thrown. The fix is to add back in the "if" check that
implictly checks if the max_items is non-0.
Test code was also created to verify that a limit of 0 is handled
correctly.
Change-Id: I92f9afb9b0e2c627d2c77f67fa026b731903384f
Closes-bug:
1289124