mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
11013fd894
In order to support this, we change the Image#save to accept params from the user, and call insert_image. Also, we populate the image model with the project name before returning the object to the user.
18 lines
627 B
Ruby
18 lines
627 B
Ruby
def test
|
|
connection = Fog::Compute.new({ :provider => "Google" })
|
|
|
|
rawdisk = {
|
|
:source => nil, # 'http://some_valid_url_to_rootfs_tarball'
|
|
:container_type => 'TAR',
|
|
}
|
|
|
|
# Can't test this unless the 'source' points to a valid URL
|
|
return if rawdisk[:source].nil?
|
|
|
|
img = connection.image.create(:name => 'test-image',
|
|
:preferred_kernel => 'gce-v20130603',
|
|
:description => 'Test image (via fog)',
|
|
:raw_disk => rawdisk)
|
|
|
|
img.reload # will raise if image was not saved correctly
|
|
end
|