New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement create_ and destroy_volume_snapshot for OS #478

Merged
merged 1 commit into from Mar 27, 2015

Conversation

Projects
None yet
5 participants
@allardhoeve
Contributor

allardhoeve commented Mar 6, 2015

The OS driver currently implements ex_create_snapshot and ex_delete_snapshot instead of create_volume_snapshot and delete_volume_snapshot. This PR fixes that.

  • Add libcloud.compute.drivers.openstack.create_volume_snapshot.
  • Add libcloud.compute.drivers.openstack.destroy_volume_snapshot.
  • Clean up base signature to match current implementations: the name argument is considered optional by all drivers that use the signature.
  • The CloudStack signature was breaking contract by not accepting the name argument.
  • Documented that CloudStack disregards any name given to a new snapshot even though it accepts the argument.
  • Fixed a lot of docstrings.
  • Removes superfluous docstrings that matched the base docstring.
Show outdated Hide outdated libcloud/compute/drivers/openstack.py
@@ -1611,6 +1611,41 @@ def list_volume_snapshots(self, volume):
return [snapshot for snapshot in self.ex_list_snapshots()
if snapshot.extra['volume_id'] == volume.id]
def create_volume_snapshot(self, volume, name, ex_description=None,

This comment has been minimized.

@mvschaik

mvschaik Mar 6, 2015

Contributor

Is name optional here? Or does OpenStack mandate a name?

@mvschaik

mvschaik Mar 6, 2015

Contributor

Is name optional here? Or does OpenStack mandate a name?

This comment has been minimized.

@allardhoeve

allardhoeve Mar 6, 2015

Contributor

Nope, should be optional, like the base driver. Updating in 3, 2, 1.

@allardhoeve

allardhoeve Mar 6, 2015

Contributor

Nope, should be optional, like the base driver. Updating in 3, 2, 1.

@sebgoa

This comment has been minimized.

Show comment
Hide comment
@sebgoa

sebgoa Mar 10, 2015

Member

@allardhoeve will you merge this ?

Member

sebgoa commented Mar 10, 2015

@allardhoeve will you merge this ?

@allardhoeve

This comment has been minimized.

Show comment
Hide comment
@allardhoeve

allardhoeve Mar 10, 2015

Contributor

If you give the 👍, yes.

Contributor

allardhoeve commented Mar 10, 2015

If you give the 👍, yes.

@sebgoa

This comment has been minimized.

Show comment
Hide comment
@sebgoa

sebgoa Mar 10, 2015

Member

Seems you got conflicts. Usually I also try to squash commits. Since it touches base let's get @Kami to chime in

Member

sebgoa commented Mar 10, 2015

Seems you got conflicts. Usually I also try to squash commits. Since it touches base let's get @Kami to chime in

@allardhoeve

This comment has been minimized.

Show comment
Hide comment
@allardhoeve

allardhoeve Mar 10, 2015

Contributor

I prefer to merge trunk into my branch, because that way I only have to deal with recent changes. But I get the feeling you guys prefer linear history? That is: simple git lola trees? Will rebase when it's ready.

Contributor

allardhoeve commented Mar 10, 2015

I prefer to merge trunk into my branch, because that way I only have to deal with recent changes. But I get the feeling you guys prefer linear history? That is: simple git lola trees? Will rebase when it's ready.

@allardhoeve

This comment has been minimized.

Show comment
Hide comment
@allardhoeve

allardhoeve Mar 14, 2015

Contributor

@Kami, what do you think of the API change?

Contributor

allardhoeve commented Mar 14, 2015

@Kami, what do you think of the API change?

Show outdated Hide outdated CHANGES.rst
@@ -15,6 +15,12 @@ General
Compute
~~~~~~~
- Deprecated ex_create_snapshot and ex_delete_snapshot in favor of
create_storage_volume and destroy_storage_volume. Updated base driver

This comment has been minimized.

@Kami

Kami Mar 14, 2015

Member

This should say create_volume_snapshot and destroy_volume_snapshot, right?

@Kami

Kami Mar 14, 2015

Member

This should say create_volume_snapshot and destroy_volume_snapshot, right?

This comment has been minimized.

@Kami

Kami Mar 14, 2015

Member

Should also say that you deprecated those methods in the OpenStack driver.

@Kami

Kami Mar 14, 2015

Member

Should also say that you deprecated those methods in the OpenStack driver.

@Kami

This comment has been minimized.

Show comment
Hide comment
@Kami

Kami Mar 14, 2015

Member

Thanks. Change looks good to me - +1

Member

Kami commented Mar 14, 2015

Thanks. Change looks good to me - +1

Allard Hoeve
Document functions and update signature
- Document create_volume_snapshot arguments properly
- Document destroy_volume_snapshot arguments properly
- Update signature to match all existing implementations
  - name should be optional

closes #478

@asfgit asfgit merged commit b81ede3 into apache:trunk Mar 27, 2015

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment