From 28d4d6bfd09063e8d814cf64ef504aa01a9a90e7 Mon Sep 17 00:00:00 2001 From: John Griffith Date: Tue, 30 Oct 2012 10:24:47 -0600 Subject: [PATCH] Remove attach/detach code from cinderclient Attach and Detach actions are done in the novaclient, however during the creation of Cinder a number of these methods were copied into the Cinder client. This is dead code and just adds confusion, so let's rip it out. Change-Id: Ib96fe0cac26f19e7d9f2aa01c71ba9762e4f8b8e Fixes: bug #1071003 --- cinderclient/v1/volumes.py | 46 -------------------------------------- 1 file changed, 46 deletions(-) diff --git a/cinderclient/v1/volumes.py b/cinderclient/v1/volumes.py index fee82eb64..fb984187e 100644 --- a/cinderclient/v1/volumes.py +++ b/cinderclient/v1/volumes.py @@ -197,52 +197,6 @@ class VolumeManager(base.ManagerWithFind): self._update("/volumes/%s" % base.getid(volume), body) - def create_server_volume(self, server_id, volume_id, device): - """ - Attach a volume identified by the volume ID to the given server ID - - :param server_id: The ID of the server - :param volume_id: The ID of the volume to attach. - :param device: The device name - :rtype: :class:`Volume` - """ - body = {'volumeAttachment': {'volumeId': volume_id, - 'device': device}} - return self._create("/servers/%s/os-volume_attachments" % server_id, - body, "volumeAttachment") - - def get_server_volume(self, server_id, attachment_id): - """ - Get the volume identified by the attachment ID, that is attached to - the given server ID - - :param server_id: The ID of the server - :param attachment_id: The ID of the attachment - :rtype: :class:`Volume` - """ - return self._get("/servers/%s/os-volume_attachments/%s" % (server_id, - attachment_id,), "volumeAttachment") - - def get_server_volumes(self, server_id): - """ - Get a list of all the attached volumes for the given server ID - - :param server_id: The ID of the server - :rtype: list of :class:`Volume` - """ - return self._list("/servers/%s/os-volume_attachments" % server_id, - "volumeAttachments") - - def delete_server_volume(self, server_id, attachment_id): - """ - Detach a volume identified by the attachment ID from the given server - - :param server_id: The ID of the server - :param attachment_id: The ID of the attachment - """ - self._delete("/servers/%s/os-volume_attachments/%s" % - (server_id, attachment_id,)) - def _action(self, action, volume, info=None, **kwargs): """ Perform a volume "action."