nova client cinder query param changed to display_name

nova client is not able to show the list of volumes when
querying by name.This is because cinder api accepts only
display_name as query parameter and when qeried with 'name'
parameter returns a empty list

Change-Id: Ie4ffc275d1754052d9e239d8457baf6f7fd53b83
Closes-Bug: #1430415
This commit is contained in:
Anand Shanmugam 2015-03-11 20:48:46 +05:30
parent 876a3bd80a
commit 41ef74971e
2 changed files with 4 additions and 1 deletions

View File

@ -2145,7 +2145,7 @@ class ShellTest(utils.TestCase):
def test_volume_show(self):
self.run_command('volume-show Work')
self.assert_called('GET', '/volumes?name=Work', pos=-2)
self.assert_called('GET', '/volumes?display_name=Work', pos=-2)
self.assert_called(
'GET',
'/volumes/15e59938-07d5-11e1-90e3-e3dffe0c5983',

View File

@ -86,6 +86,9 @@ class VolumeManager(base.ManagerWithFind):
"""
search_opts = search_opts or {}
if 'name' in search_opts.keys():
search_opts['display_name'] = search_opts.pop('name')
qparams = dict((k, v) for (k, v) in six.iteritems(search_opts) if v)
query_string = '?%s' % parse.urlencode(qparams) if qparams else ''