Sha256: fdd7af9fbbf1424a2d64bbc57b819f84efa3fd1020cf54cc92f39280b490635a

Contents?: true

Size: 1.24 KB

Versions: 7

Compression:

Stored size: 1.24 KB

Contents

require_relative "../../../synced_folders/unix_mount_helpers"

module VagrantPlugins
  module ProviderVirtualBox
    module Cap
      module MountOptions
        extend VagrantPlugins::SyncedFolder::UnixMountHelpers

        VB_MOUNT_TYPE = "vboxsf".freeze

        # Returns mount options for a virtual box synced folder
        #
        # @param [Machine] machine
        # @param [String] name of mount
        # @param [String] path of mount on guest
        # @param [Hash] hash of mount options 
        def self.mount_options(machine, name, guest_path, options)
          mount_options = options.fetch(:mount_options, [])
          detected_ids = detect_owner_group_ids(machine, guest_path, mount_options, options)
          mount_uid = detected_ids[:uid]
          mount_gid = detected_ids[:gid]

          mount_options << "uid=#{mount_uid}"
          mount_options << "gid=#{mount_gid}"
          mount_options << "_netdev"
          mount_options = mount_options.join(',')
          return mount_options, mount_uid, mount_gid
        end

        def self.mount_type(machine)
          return VB_MOUNT_TYPE
        end

        def self.mount_name(machine, name, data)
          name.gsub(/[\s\/\\]/,'_').sub(/^_/, '')
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/providers/virtualbox/cap/mount_options.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/providers/virtualbox/cap/mount_options.rb
vagrant-unbundled-2.3.3.0 plugins/providers/virtualbox/cap/mount_options.rb
vagrant-unbundled-2.3.2.0 plugins/providers/virtualbox/cap/mount_options.rb
vagrant-unbundled-2.2.19.0 plugins/providers/virtualbox/cap/mount_options.rb
vagrant-unbundled-2.2.18.0 plugins/providers/virtualbox/cap/mount_options.rb
vagrant-unbundled-2.2.16.0 plugins/providers/virtualbox/cap/mount_options.rb