Merge "nova client cinder query param changed to display_name"

This commit is contained in:
Jenkins 2015-03-12 18:32:26 +00:00 committed by Gerrit Code Review
commit b4fc9e0d2c
2 changed files with 4 additions and 1 deletions
novaclient

@ -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',

@ -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 ''