From 4498879c7ab4541c38b26052e5fd059a7d15811a Mon Sep 17 00:00:00 2001 From: Rupak Ganguly Date: Tue, 31 Jan 2012 18:26:13 -0500 Subject: [PATCH] Add some attributes that are implemented as methods. --- lib/fog/hp/models/compute/server.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/fog/hp/models/compute/server.rb b/lib/fog/hp/models/compute/server.rb index 1bcd4a8d7..6c9efa889 100644 --- a/lib/fog/hp/models/compute/server.rb +++ b/lib/fog/hp/models/compute/server.rb @@ -24,6 +24,11 @@ module Fog attribute :tenant_id attribute :user_id attribute :key_name + # these are implemented as methods + attribute :image_id + attribute :flavor_id + attribute :private_ip_address + attribute :public_ip_address attr_reader :password attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username, :image_id, :flavor_id @@ -48,7 +53,8 @@ module Fog end def private_ip_address - addresses.nil? ? nil : addresses['private'].first + addr = addresses.nil? ? nil : addresses.fetch('private', []).first + addr["addr"] if addr end def private_key_path @@ -61,7 +67,8 @@ module Fog end def public_ip_address - addresses.nil? ? nil : addresses['public'].first + addr = addresses.nil? ? nil : addresses.fetch('public', []).first + addr["addr"] if addr end def public_key_path