From 3970ab57972f196aff4679115bacce28fef96a6c Mon Sep 17 00:00:00 2001 From: Grzesiek Kolodziejczyk Date: Wed, 3 Jul 2013 12:24:55 +0200 Subject: [PATCH] [Openstack|volume] Add #get to volumes collection This fixes reloading Volume objects and makes it consistent with other collections. Keeping find_by_id as an alias for compatibility. --- lib/fog/openstack/models/volume/volumes.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/fog/openstack/models/volume/volumes.rb b/lib/fog/openstack/models/volume/volumes.rb index 47faf8a4f..8924b5214 100644 --- a/lib/fog/openstack/models/volume/volumes.rb +++ b/lib/fog/openstack/models/volume/volumes.rb @@ -12,13 +12,14 @@ module Fog load(service.list_volumes(detailed).body['volumes']) end - def find_by_id(volume_id) + def get(volume_id) if volume = service.get_volume_details(volume_id).body['volume'] new(volume) end rescue Fog::Volume::OpenStack::NotFound nil end + alias_method :find_by_id, :get end end