Merge "Fix error in CLI 'manila list' with sorting key 'availability_zone'."
This commit is contained in:
@@ -20,7 +20,7 @@ SORT_DIR_VALUES = ('asc', 'desc')
|
|||||||
|
|
||||||
SHARE_SORT_KEY_VALUES = (
|
SHARE_SORT_KEY_VALUES = (
|
||||||
'id', 'status', 'size', 'host', 'share_proto',
|
'id', 'status', 'size', 'host', 'share_proto',
|
||||||
'availability_zone',
|
'availability_zone_id', 'availability_zone',
|
||||||
'user_id', 'project_id',
|
'user_id', 'project_id',
|
||||||
'created_at', 'updated_at',
|
'created_at', 'updated_at',
|
||||||
'display_name', 'name',
|
'display_name', 'name',
|
||||||
|
@@ -332,6 +332,8 @@ class ShellTest(test_utils.TestCase):
|
|||||||
key = 'share_network_id' if key == 'share_network' else key
|
key = 'share_network_id' if key == 'share_network' else key
|
||||||
key = 'snapshot_id' if key == 'snapshot' else key
|
key = 'snapshot_id' if key == 'snapshot' else key
|
||||||
key = 'share_type_id' if key == 'share_type' else key
|
key = 'share_type_id' if key == 'share_type' else key
|
||||||
|
key = ('availability_zone_id' if key == 'availability_zone'
|
||||||
|
else key)
|
||||||
self.assert_called('GET', '/shares/detail?sort_key=' + key)
|
self.assert_called('GET', '/shares/detail?sort_key=' + key)
|
||||||
|
|
||||||
def test_list_with_fake_sort_key(self):
|
def test_list_with_fake_sort_key(self):
|
||||||
|
@@ -388,6 +388,8 @@ class ShareManager(base.ManagerWithFind):
|
|||||||
search_opts['sort_key'] = 'snapshot_id'
|
search_opts['sort_key'] = 'snapshot_id'
|
||||||
elif sort_key == 'share_network':
|
elif sort_key == 'share_network':
|
||||||
search_opts['sort_key'] = 'share_network_id'
|
search_opts['sort_key'] = 'share_network_id'
|
||||||
|
elif sort_key == 'availability_zone':
|
||||||
|
search_opts['sort_key'] = 'availability_zone_id'
|
||||||
else:
|
else:
|
||||||
raise ValueError('sort_key must be one of the following: %s.'
|
raise ValueError('sort_key must be one of the following: %s.'
|
||||||
% ', '.join(constants.SHARE_SORT_KEY_VALUES))
|
% ', '.join(constants.SHARE_SORT_KEY_VALUES))
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
`Launchpad bug 1920888 <https://bugs.launchpad.net/manila/+bug/1920888>`_:
|
||||||
|
Fix the bug in CLI 'manila list' with sorting key 'availability_zone'.
|
Reference in New Issue
Block a user