mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[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.
This commit is contained in:
parent
8433a74807
commit
3970ab5797
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue