Sha256: 95bba48e891004234b61a815dde801ba755985f2a4047ff68f8cfc8e39d162c9
Contents?: true
Size: 793 Bytes
Versions: 31
Compression:
Stored size: 793 Bytes
Contents
module Fog module Compute class Vsphere class Real def create_folder(datacenter, path, name) #Path cannot be nil but it can be an empty string raise ArgumentError, "Path cannot be nil" if path.nil? parent_folder = get_raw_vmfolder(path, datacenter) begin new_folder = parent_folder.CreateFolder(:name => name) # output is cleaned up to return the new path # new path will be path/name, example: "Production/Pool1" new_folder.path.reject { |a| a.first.class == "Folder" }.map { |a| a.first.name }.join("/").sub(/^\/?Datacenters\/#{datacenter}\/vm\/?/, '') rescue => e raise e, "failed to create folder: #{e}" end end end end end end
Version data entries
31 entries across 31 versions & 5 rubygems