1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #1764 from grimme-atix-de/localization

[VSphere] Removed hard coded dependency to the Datacenters root path.
This commit is contained in:
Ohad Levy 2013-05-05 05:04:33 -07:00
commit aed355a10a

View file

@ -27,9 +27,11 @@ module Fog
# The required path syntax - 'topfolder/subfolder
# Clean up path to be relative since we're providing datacenter name
paths = path.sub(/^\/?Datacenters\/#{datacenter_name}\/vm\/?/, '').split('/')
dc = find_raw_datacenter(datacenter_name)
dc_root_folder = dc.vmFolder
# Filter the root path for this datacenter not to be used."
dc_root_folder_path=dc_root_folder.path.map { | id, name | name }.join("/")
paths = path.sub(/^\/?#{dc_root_folder_path}\/?/, '').split('/')
return dc_root_folder if paths.empty?
# Walk the tree resetting the folder pointer as we go