From 07caa0fba6f677f296bd28011bc4b82feee4d500 Mon Sep 17 00:00:00 2001 From: Nat Welch Date: Thu, 25 Jul 2013 12:22:12 -0700 Subject: [PATCH] fix some small bugs in the gce smoke tests --- lib/fog/google/examples/create.rb | 14 ++++++++------ lib/fog/google/examples/launch_micro_instance.rb | 5 ++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/fog/google/examples/create.rb b/lib/fog/google/examples/create.rb index 0ce176ff6..c2b77d860 100755 --- a/lib/fog/google/examples/create.rb +++ b/lib/fog/google/examples/create.rb @@ -4,11 +4,11 @@ def test server = connection.servers.create(defaults = { :name => "fog-smoke-test-#{Time.now.to_i}", :image_name => "debian-7-wheezy-v20130522", - :machine_type => "n1-standard-1", - :zone_name => "us-central1-a", - :private_key_path => File.expand_path("~/.ssh/id_rsa"), - :public_key_path => File.expand_path("~/.ssh/id_rsa.pub"), - :user => ENV['USER'], + :machine_type => "n1-standard-1", + :zone_name => "us-central1-a", + :private_key_path => File.expand_path("~/.ssh/id_rsa"), + :public_key_path => File.expand_path("~/.ssh/id_rsa.pub"), + :user => ENV['USER'], }) # My own wait_for because it hides errors @@ -19,7 +19,9 @@ def test until server.sshable? || duration > timeout # puts duration # puts " ----- " - # p server.reload + + server.reload + # p "ready?: #{server.ready?}" # p "public_ip_address: #{server.public_ip_address.inspect}" # p "public_key: #{server.public_key.inspect}" diff --git a/lib/fog/google/examples/launch_micro_instance.rb b/lib/fog/google/examples/launch_micro_instance.rb index 5ff8ca183..8eae0dc35 100755 --- a/lib/fog/google/examples/launch_micro_instance.rb +++ b/lib/fog/google/examples/launch_micro_instance.rb @@ -1,10 +1,9 @@ def test connection = Fog::Compute.new({ :provider => "Google" }) time = Time.now.utc.to_i - disk = CONNECTION.disks.create({:name => 'foggydisk', :size => 10, :zone_name => 'us-central1-a', :image_name => 'centos-6-v20130522'}) + disk = connection.disks.create({:name => 'foggydisk', :size => 10, :zone_name => 'us-central1-a', :image_name => 'centos-6-v20130522'}) disk.wait_for { disk.ready? } - puts 'disk ready' disk = disk.get_as_boot_disk(true) params = { :name => "fog-smoke-test-#{Time.now.to_i}", @@ -15,7 +14,7 @@ def test :user => ENV['USER'] } - server = CONNECTION.servers.bootstrap params + server = connection.servers.bootstrap params raise "Could not bootstrap sshable server." unless server.ssh("whoami") raise "Could not delete server." unless server.destroy