Fix signature for create_volume to align with the base API
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b7007629 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b7007629 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b7007629 Branch: refs/heads/trunk Commit: b700762960ab4d8810fd3cc26aa49ac86beaeee8 Parents: 40a18cb Author: Rick Wright <[email protected]> Authored: Fri Dec 20 14:20:40 2013 -0800 Committer: Rick Wright <[email protected]> Committed: Fri Dec 20 14:20:40 2013 -0800 ---------------------------------------------------------------------- libcloud/compute/drivers/gce.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/b7007629/libcloud/compute/drivers/gce.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py index df865b4..25bafcf 100644 --- a/libcloud/compute/drivers/gce.py +++ b/libcloud/compute/drivers/gce.py @@ -1632,8 +1632,8 @@ class GCENodeDriver(NodeDriver): return self.ex_get_targetpool(name, region) - def _create_vol_req(self, size, name, location=None, image=None, - snapshot=None): + def _create_vol_req(self, size, name, location=None, snapshot=None, + image=None): """ Assemble the request/data for creating a volume. @@ -1650,12 +1650,12 @@ class GCENodeDriver(NodeDriver): :type location: ``str`` or :class:`GCEZone` or :class:`NodeLocation` or ``None`` - :keyword image: Image to create disk from. - :type image: :class:`NodeImage` or ``str`` or ``None`` - :keyword snapshot: Snapshot to create image from :type snapshot: :class:`GCESnapshot` or ``str`` or ``None`` + :keyword image: Image to create disk from. + :type image: :class:`NodeImage` or ``str`` or ``None`` + :return: Tuple containg the request string, the data dictionary and the URL parameters :rtype: ``tuple`` @@ -1687,8 +1687,8 @@ class GCENodeDriver(NodeDriver): return request, volume_data, params - def create_volume(self, size, name, location=None, image=None, - snapshot=None, use_existing=True): + def create_volume(self, size, name, location=None, snapshot=None, + image=None, use_existing=True): """ Create a volume (disk). @@ -1703,12 +1703,12 @@ class GCENodeDriver(NodeDriver): :type location: ``str`` or :class:`GCEZone` or :class:`NodeLocation` or ``None`` - :keyword image: Image to create disk from. - :type image: :class:`NodeImage` or ``str`` or ``None`` - :keyword snapshot: Snapshot to create image from :type snapshot: :class:`GCESnapshot` or ``str`` or ``None`` + :keyword image: Image to create disk from. + :type image: :class:`NodeImage` or ``str`` or ``None`` + :keyword use_existing: If True and a disk with the given name already exists, return an object for that disk instead of attempting to create a new disk. @@ -1718,7 +1718,7 @@ class GCENodeDriver(NodeDriver): :rtype: :class:`StorageVolume` """ request, volume_data, params = self._create_vol_req( - size, name, location, image, snapshot) + size, name, location, snapshot, image) try: self.connection.async_request(request, method='POST', data=volume_data, params=params)
