diff --git a/novaclient/tests/unit/v2/test_shell.py b/novaclient/tests/unit/v2/test_shell.py index 71eb85ee8..0b69f437a 100644 --- a/novaclient/tests/unit/v2/test_shell.py +++ b/novaclient/tests/unit/v2/test_shell.py @@ -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', diff --git a/novaclient/v2/volumes.py b/novaclient/v2/volumes.py index 9b9cf1886..99e3d6fed 100644 --- a/novaclient/v2/volumes.py +++ b/novaclient/v2/volumes.py @@ -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 ''