lib/fog/google/examples/launch_micro_instance.rb in fog-1.20.0 vs lib/fog/google/examples/launch_micro_instance.rb in fog-1.21.0

- old
+ new

@@ -1,13 +1,13 @@ def test connection = Fog::Compute.new({ :provider => "Google" }) time = Time.now.utc.to_i disk = connection.disks.create({ - :name => 'foggydisk', + :name => "foggydisk-#{time}", :size_gb => 10, :zone_name => 'us-central1-a', - :source_image => 'centos-6-v20130522', + :source_image => 'centos-6-v20131120', }) disk.wait_for { disk.ready? } params = { :name => "fog-smoke-test-#{Time.now.to_i}", @@ -17,9 +17,13 @@ :user => ENV['USER'] } server = connection.servers.bootstrap params - raise "Could not bootstrap sshable server." unless server.ssh("whoami") - raise "Could not delete server." unless server.destroy - raise "Could not delete disk." unless disk.destroy + begin + raise "Could not bootstrap sshable server." unless server.ssh("whoami") + raise "Could not delete server." unless server.destroy + raise "Could not delete disk." unless disk.destroy + rescue Exception => e + p e.message + end end