lib/vmpooler/providers/vsphere.rb
def purge_unconfigured_folders(base_folders, configured_folders, whitelist)
          @connection_pool.with_metrics do |pool_object|
            connection = ensured_vsphere_connection(pool_object)

            base_folders.each do |base_folder|
              folder_children = get_folder_children(base_folder, connection)
              next if folder_children.empty?

              folder_children.each do |folder_hash|
                folder_hash.each do |folder_title, folder_object|
                  destroy_folder_and_children(folder_object) unless folder_configured?(folder_title, base_folder, configured_folders, whitelist)
                end
              end
            end
          end
        end
# The connection_pool method is normally used only for testing
The connection_pool method is normally used only for testing
The connection_pool method is normally used only for testing
def purge_unconfigured_folders(base_folders, configured_folders, whitelist)
          @connection_pool.with_metrics do |pool_object|
            connection = ensured_vsphere_connection(pool_object)
            base_folders.each do |base_folder|
              folder_children = get_folder_children(base_folder, connection)
              next if folder_children.empty?
              folder_children.each do |folder_hash|
                folder_hash.each do |folder_title, folder_object|
                  destroy_folder_and_children(folder_object) unless folder_configured?(folder_title, base_folder, configured_folders, whitelist)
                end
              end
            end
          end
        end
def purge_unconfigured_folders ( base_folders , configured_folders , whitelist ) @connection_pool . with_metrics do | pool_object | connection = ensured_vsphere_connection ( pool_object ) base_folders . each do | base_folder | folder_children = get_folder_children ( base_folder , connection ) next if folder_children . empty? folder_children . each do | folder_hash | folder_hash . each do | folder_title , folder_object | destroy_folder_and_children ( folder_object ) unless folder_configured? ( folder_title , base_folder , configured_folders , whitelist ) end end end end end
The connection_pool method is normally used only for testing
The connection_pool method is normally used only for testing
base_folders
configured_folders
whitelist