get_ebs

in cookbooks/aws-parallelcluster-environment/recipes/config/update_shared_storages.rb [46:66]


  def get_ebs(action)
    
    if action == UNMOUNT_ACTION
      in_shared_storages_mapping = node['cluster']['shared_storages_mapping']
      not_in_shared_storages_mapping = node['cluster']['update_shared_storages_mapping']
    elsif action == MOUNT_ACTION
      in_shared_storages_mapping = node['cluster']['update_shared_storages_mapping']
      not_in_shared_storages_mapping = node['cluster']['shared_storages_mapping']
    end
    shared_dir_array = []
    vol_array = []
    unless in_shared_storages_mapping["ebs"].nil?
      in_shared_storages_mapping["ebs"].each do |storage|
        next unless not_in_shared_storages_mapping["ebs"].nil? || !not_in_shared_storages_mapping["ebs"].include?(storage)
        shared_dir_array.push(storage["mount_dir"])
        vol_array.push(storage["volume_id"])
      end
    end
    [shared_dir_array, vol_array]
  end