1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

added create_snapshot method to Fog::Rackspace::BlockStorage::Volume

This commit is contained in:
Kyle Rames 2012-12-19 16:32:23 -06:00
parent 140f09472d
commit 21d5892d44
2 changed files with 12 additions and 5 deletions

View file

@ -35,6 +35,11 @@ module Fog
connection.snapshots.select { |s| s.volume_id == identity }
end
def create_snapshot(options={})
requires :identity
connection.snapshots.create(options.merge(:volume_id => identity))
end
def save
requires :size
data = connection.create_volume(size, {

View file

@ -14,13 +14,15 @@ Shindo.tests('Fog::Rackspace::BlockStorage | volume', ['rackspace']) do
end
tests('#snapshots').succeeds do
snapshot = service.snapshots.create({ :volume_id => @instance.id })
snapshot.wait_for { ready? }
begin
snapshot = @instance.create_snapshot
snapshot.wait_for(timeout=1200) { ready? }
returns(true) { @instance.snapshots.first.id == snapshot.id }
ensure
snapshot.destroy
end
end
@instance.wait_for { snapshots.empty? }
end