mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Fix nested folders in get virtual machine
This commit is contained in:
parent
268c6d5502
commit
458644e745
1 changed files with 4 additions and 3 deletions
|
@ -32,8 +32,9 @@ module Fog
|
||||||
vms = raw_list_all_virtual_machines(dc)
|
vms = raw_list_all_virtual_machines(dc)
|
||||||
|
|
||||||
if name.include?('/')
|
if name.include?('/')
|
||||||
folder, basename = name.split('/')
|
folder = File.dirname(name)
|
||||||
vms.keep_if { |v| v["name"] == basename && v.parent["name"] == folder }.first
|
basename = File.basename(name)
|
||||||
|
vms.keep_if { |v| v["name"] == basename && v.parent.pretty_path.include?(folder) }.first
|
||||||
else
|
else
|
||||||
vms.keep_if { |v| v["name"] == name }.first
|
vms.keep_if { |v| v["name"] == name }.first
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue