diff --git a/novaclient/utils.py b/novaclient/utils.py index d866b7200..991a436b3 100644 --- a/novaclient/utils.py +++ b/novaclient/utils.py @@ -179,8 +179,8 @@ def find_resource(manager, name_or_id): return manager.find(name=name_or_id) except exceptions.NotFound: try: - # Volumes does not have name, but displayName - return manager.find(displayName=name_or_id) + # Volumes does not have name, but display_name + return manager.find(display_name=name_or_id) except exceptions.NotFound: msg = "No %s with a name or ID of '%s' exists." % \ (manager.resource_class.__name__.lower(), name_or_id) diff --git a/novaclient/v1_1/shell.py b/novaclient/v1_1/shell.py index 46beab37a..a67d87424 100644 --- a/novaclient/v1_1/shell.py +++ b/novaclient/v1_1/shell.py @@ -915,7 +915,6 @@ def do_volume_delete(cs, args): help='Name or ID of server.') @utils.arg('volume', metavar='', - type=int, help='ID of the volume to attach.') @utils.arg('device', metavar='', help='Name of the device e.g. /dev/vdb.') @@ -931,7 +930,6 @@ def do_volume_attach(cs, args): help='Name or ID of server.') @utils.arg('attachment_id', metavar='', - type=int, help='Attachment ID of the volume.') def do_volume_detach(cs, args): """Detach a volume from a server.""" diff --git a/tests/test_utils.py b/tests/test_utils.py index 5cf7bd81e..44006e420 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -16,7 +16,7 @@ def __init__(self, _id, properties): except KeyError: pass try: - self.displayName = properties['displayName'] + self.display_name = properties['display_name'] except KeyError: pass @@ -28,7 +28,7 @@ class FakeManager(base.ManagerWithFind): resources = [ FakeResource('1234', {'name': 'entity_one'}), FakeResource(UUID, {'name': 'entity_two'}), - FakeResource('4242', {'displayName': 'entity_three'}), + FakeResource('4242', {'display_name': 'entity_three'}), FakeResource('5678', {'name': '9876'}) ]