Skip to content

Commit

Permalink
sshfs_mount: rename to sshfs_forward_mount
Browse files Browse the repository at this point in the history
In preparation for adding reverse mounting capabilities we'll rename
all existing functions to be known as "forward mounting" where:

- reverse: mounting guest directory onto the host
- forward: mounting host direcotry into the guest

Forward mounting is how vagrant-sshfs acts today and is the most
common use case.
  • Loading branch information
dustymabe committed Jul 28, 2016
1 parent f0dbca9 commit 9caebaa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/vagrant-sshfs/cap/guest/linux/sshfs_mount.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MountSSHFS
extend Vagrant::Util::Retryable
@@logger = Log4r::Logger.new("vagrant::synced_folders::sshfs_mount")

def self.sshfs_is_folder_mounted(machine, opts)
def self.sshfs_forward_is_folder_mounted(machine, opts)
mounted = false
# expand the guest path so we can handle things like "~/vagrant"
expanded_guest_path = machine.guest.capability(
Expand All @@ -34,7 +34,7 @@ def self.sshfs_is_folder_mounted(machine, opts)
return mounted
end

def self.sshfs_mount_folder(machine, opts)
def self.sshfs_forward_mount_folder(machine, opts)
# opts contains something like:
# { :type=>:sshfs,
# :guestpath=>"/sharedfolder",
Expand Down Expand Up @@ -76,7 +76,7 @@ def self.sshfs_mount_folder(machine, opts)
end
end

def self.sshfs_unmount_folder(machine, opts)
def self.sshfs_forward_unmount_folder(machine, opts)
# opts contains something like:
# { :type=>:sshfs,
# :guestpath=>"/sharedfolder",
Expand Down
6 changes: 3 additions & 3 deletions lib/vagrant-sshfs/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ class Plugin < Vagrant.plugin("2")
Command::SSHFS
end

guest_capability("linux", "sshfs_mount_folder") do
guest_capability("linux", "sshfs_forward_mount_folder") do
require_relative "cap/guest/linux/sshfs_mount"
VagrantPlugins::GuestLinux::Cap::MountSSHFS
end

guest_capability("linux", "sshfs_unmount_folder") do
guest_capability("linux", "sshfs_forward_unmount_folder") do
require_relative "cap/guest/linux/sshfs_mount"
VagrantPlugins::GuestLinux::Cap::MountSSHFS
end

guest_capability("linux", "sshfs_is_folder_mounted") do
guest_capability("linux", "sshfs_forward_is_folder_mounted") do
require_relative "cap/guest/linux/sshfs_mount"
VagrantPlugins::GuestLinux::Cap::MountSSHFS
end
Expand Down
8 changes: 4 additions & 4 deletions lib/vagrant-sshfs/synced_folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def enable(machine, folders, pluginopts)
folders.each do |id, opts|

# If already mounted then there is nothing to do
if machine.guest.capability(:sshfs_is_folder_mounted, opts)
if machine.guest.capability(:sshfs_forward_is_folder_mounted, opts)
machine.ui.info(
I18n.t("vagrant.sshfs.info.already_mounted",
folder: opts[:guestpath]))
Expand All @@ -75,7 +75,7 @@ def enable(machine, folders, pluginopts)
end
# Do the mount
machine.ui.info(I18n.t("vagrant.sshfs.actions.mounting"))
machine.guest.capability(:sshfs_mount_folder, opts)
machine.guest.capability(:sshfs_forward_mount_folder, opts)
end
end

Expand All @@ -95,7 +95,7 @@ def disable(machine, folders, opts)
folders.each do |id, opts|

# If not mounted then there is nothing to do
if ! machine.guest.capability(:sshfs_is_folder_mounted, opts)
if ! machine.guest.capability(:sshfs_forward_is_folder_mounted, opts)
machine.ui.info(
I18n.t("vagrant.sshfs.info.not_mounted",
folder: opts[:guestpath]))
Expand All @@ -104,7 +104,7 @@ def disable(machine, folders, opts)

# Do the Unmount
machine.ui.info(I18n.t("vagrant.sshfs.actions.unmounting"))
machine.guest.capability(:sshfs_unmount_folder, opts)
machine.guest.capability(:sshfs_forward_unmount_folder, opts)
end
end

Expand Down

0 comments on commit 9caebaa

Please sign in to comment.