It should return [], not [''].
Reported-by: Eric Chen <Eric_YH_Chen@wistron.com>
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
break
elif ret != -errno.ERANGE:
raise make_ex(ret, 'error listing images')
- return c_names.raw.rstrip('\0').split('\0')
+ return filter(lambda name: name != '', c_names.raw.split('\0'))
def remove(self, ioctx, name):
"""
def test_remove_dne():
assert_raises(ImageNotFound, remove_image)
+def test_list_empty():
+ eq([], RBD().list(ioctx))
+
@with_setup(create_image, remove_image)
def test_list():
eq([IMG_NAME], RBD().list(ioctx))