From 5d5c87d1eda85e3dae866381aeeed2248b7c5443 Mon Sep 17 00:00:00 2001 From: Lucas Carlson Date: Wed, 26 Jan 2011 02:58:12 -0800 Subject: [PATCH] Add gogrid idiosyncracies with reloading data --- fog.gemspec | 2 +- lib/fog/compute/models/go_grid/server.rb | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/fog.gemspec b/fog.gemspec index 6d6ecedc0..628a67919 100644 --- a/fog.gemspec +++ b/fog.gemspec @@ -7,7 +7,7 @@ Gem::Specification.new do |s| ## If your rubyforge_project name is different, then edit it and comment out ## the sub! line in the Rakefile s.name = 'phpfog-fog' - s.version = '0.4.1.2' + s.version = '0.4.1.3' s.date = '2011-01-21' s.rubyforge_project = 'fog' diff --git a/lib/fog/compute/models/go_grid/server.rb b/lib/fog/compute/models/go_grid/server.rb index 5968ad9f5..648709ff4 100644 --- a/lib/fog/compute/models/go_grid/server.rb +++ b/lib/fog/compute/models/go_grid/server.rb @@ -34,7 +34,20 @@ module Fog end def ready? - @state == 'On' + @state && @state["name"] == 'On' + end + + def reload + requires :name + begin + if data = collection.get(name) + new_attributes = data.attributes + merge_attributes(new_attributes) + self + end + rescue Excon::Errors::BadRequest + false + end end def save