Module: VagrantPlugins::Parallels::SyncedFolderCap::MountOptions

Extended by:
Util::UnixMountHelpers
Defined in:
lib/vagrant-parallels/cap/mount_options.rb

Constant Summary collapse

PRL_MOUNT_TYPE =
"prl_fs".freeze

Class Method Summary collapse

Methods included from Util::UnixMountHelpers

detect_owner_group_ids, emit_upstart_notification, extended, find_mount_options_id, merge_mount_options

Class Method Details

.mount_name(*args) ⇒ Object

We have to support 2 different expected interfaces of ‘mount_name` call:

Vagrant < 2.2.15:   `def self.mount_name(machine, data)`
Vagrant >= 2.2.15:  `def self.mount_name(machine, id, data)`

github.com/Parallels/vagrant-parallels/issues/384



38
39
40
41
42
43
44
45
46
# File 'lib/vagrant-parallels/cap/mount_options.rb', line 38

def self.mount_name(*args)
  if args.length >= 3
    id = args[1]
  else
    id = args[-1][:guestpath]
  end

  id.gsub(/[*":<>?|\/\\]/,'_').sub(/^_/, '')
end

.mount_options(machine, name, guest_path, options) ⇒ Object

Returns mount options for a parallels synced folder

Parameters:

  • machine (Machine)
  • name (String)

    of mount

  • path (String)

    of mount on guest

  • hash (Hash)

    of mount options



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/vagrant-parallels/cap/mount_options.rb', line 17

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

.mount_type(machine) ⇒ Object



30
31
32
# File 'lib/vagrant-parallels/cap/mount_options.rb', line 30

def self.mount_type(machine)
  return PRL_MOUNT_TYPE
end