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

Fix some issues with GCE examples and disk requests.

This commit is contained in:
Nat Welch 2013-08-13 14:41:52 -07:00
parent 6bd5eb179f
commit dea45e8621
6 changed files with 20 additions and 6 deletions

View file

@ -11,8 +11,10 @@ def test
snap = snapshots.first
# puts 'Fetching a single image from a global project...'
# puts '------------------------------------------------'
snap = connection.snapshots.get(snap)
raise 'Could not GET the snapshot' unless snap
# puts snap.inspect
if !snap.nil?
snap = connection.snapshots.get(snap)
raise 'Could not GET the snapshot' unless snap
# puts snap.inspect
end
end

View file

@ -5,7 +5,7 @@ def test
:name => 'foggydisk',
:size_gb => 10,
:zone_name => 'us-central1-a',
:image_name => 'centos-6-v20130522',
:source_image => 'centos-6-v20130522',
})
disk.wait_for { disk.ready? }

View file

@ -2,9 +2,9 @@ def test
connection = Fog::Compute.new({ :provider => "Google" })
# we create a new private network
connection.insert_network('my-private-network','10.240.0.0/16')
connection.insert_network('my-private-network', '10.240.0.0/16')
server = connection.servers.bootstrap(defaults = {
server = connection.servers.create({
:name => "fog-smoke-test-#{Time.now.to_i}",
:image_name => "debian-7-wheezy-v20130522",
:machine_type => "n1-standard-1",
@ -15,4 +15,7 @@ def test
:external_ip => false,
:user => ENV['USER'],
})
# The network won't have any firewall rules, so we won't be able to ssh in.
server.wait_for { ready? }
end

View file

@ -13,6 +13,10 @@ module Fog
class Real
def delete_disk(disk_name, zone_name)
if zone_name.start_with? 'http'
zone_name = zone_name.split('/')[-1]
end
api_method = @compute.disks.delete
parameters = {
'project' => @project,

View file

@ -16,6 +16,7 @@ module Fog
if zone_name.start_with? 'http'
zone_name = zone_name.split('/')[-1]
end
api_method = @compute.disks.get
parameters = {
'project' => @project,

View file

@ -13,6 +13,10 @@ module Fog
class Real
def get_snapshot(snap_name, project=@project)
if snap_name.nil?
raise ArgumentError.new "snap_name must not be nil."
end
api_method = @compute.snapshots.get
parameters = {
'snapshot' => snap_name,