From fb2661b8627e48fb64b128f4ac9de606ed868f9c Mon Sep 17 00:00:00 2001 From: eater Date: Thu, 18 May 2017 16:35:45 +0200 Subject: [PATCH] Fix lingering whitespaces at end of lines --- features/sshfs_cwd_mount.feature | 12 ++--- .../step_definitions/sshfs_cwd_mount_steps.rb | 6 +-- lib/vagrant-sshfs.rb | 4 +- .../cap/guest/linux/sshfs_forward_mount.rb | 46 +++++++++---------- .../cap/guest/redhat/sshfs_client.rb | 6 +-- .../cap/host/darwin/sshfs_reverse_mount.rb | 12 ++--- .../cap/host/linux/sshfs_reverse_mount.rb | 12 ++--- .../synced_folder/sshfs_forward_mount.rb | 2 +- test/misc/Vagrantfile | 2 +- 9 files changed, 51 insertions(+), 51 deletions(-) diff --git a/features/sshfs_cwd_mount.feature b/features/sshfs_cwd_mount.feature index d614a53..b351ba5 100644 --- a/features/sshfs_cwd_mount.feature +++ b/features/sshfs_cwd_mount.feature @@ -3,9 +3,9 @@ # human readable. All Gherkin files have a .feature extension # # See more here: https://en.wikipedia.org/wiki/Cucumber_(software) -# -# Additoinally in the setup/env.rb file we set up Aruba. Aruba is used -# to define most of the basic step definitions that we use as part of +# +# Additoinally in the setup/env.rb file we set up Aruba. Aruba is used +# to define most of the basic step definitions that we use as part of # the Gherkin syntax in this file. # # For more information on the step definitions provided see: @@ -21,7 +21,7 @@ Feature: SSHFS mount of vagrant current working directory # Disable the default rsync config.vm.synced_folder '.', '/vagrant', disabled: true - # If using libvirt and nested virt (vagrant in vagrant) then + # If using libvirt and nested virt (vagrant in vagrant) then # we need to use a different network than 192.168.121.0 config.vm.provider :libvirt do |libvirt| libvirt.management_network_name = 'vagrant-libvirt-test' @@ -42,5 +42,5 @@ Feature: SSHFS mount of vagrant current working directory Examples: | box | | centos/7 | - - + + diff --git a/features/step_definitions/sshfs_cwd_mount_steps.rb b/features/step_definitions/sshfs_cwd_mount_steps.rb index 1d161b5..74c378f 100644 --- a/features/step_definitions/sshfs_cwd_mount_steps.rb +++ b/features/step_definitions/sshfs_cwd_mount_steps.rb @@ -1,6 +1,6 @@ -# This is a cucumber step definition. Cucumber scenarios become automated -# tests with the addition of what are called step definitions. A step -# definition is a block of code associated with one or more steps by a +# This is a cucumber step definition. Cucumber scenarios become automated +# tests with the addition of what are called step definitions. A step +# definition is a block of code associated with one or more steps by a # regular expression (or, in simple cases, a string). # # This is the step definition for the `And vagrant current working diff --git a/lib/vagrant-sshfs.rb b/lib/vagrant-sshfs.rb index d52bf71..7fa3c52 100644 --- a/lib/vagrant-sshfs.rb +++ b/lib/vagrant-sshfs.rb @@ -4,8 +4,8 @@ raise "The Vagrant sshfs plugin must be run within Vagrant" end -# Only load the gem on Windows since it replaces some methods in Ruby's -# Process class. Also load it here before Process.uid is called the first +# Only load the gem on Windows since it replaces some methods in Ruby's +# Process class. Also load it here before Process.uid is called the first # time by Vagrant. The Process.create() function actually gets used in # lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb if Vagrant::Util::Platform.windows? diff --git a/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb b/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb index cf73497..4dc4a16 100644 --- a/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb +++ b/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb @@ -52,7 +52,7 @@ def self.sshfs_forward_mount_folder(machine, opts) # opts contains something like: # { :type=>:sshfs, # :guestpath=>"/sharedfolder", - # :hostpath=>"/guests/sharedfolder", + # :hostpath=>"/guests/sharedfolder", # :disabled=>false # :ssh_host=>"192.168.1.1" # :ssh_port=>"22" @@ -79,7 +79,7 @@ def self.sshfs_forward_mount_folder(machine, opts) opts[:sshfs_opts]+= ' -o noauto_cache '# disable caching based on mtime # Add in some ssh options that are common to both mount methods - opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question + opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question opts[:ssh_opts]+= ' -o ServerAliveInterval=30 ' # send keepalives # Do a normal mount only if the user provided host information @@ -120,25 +120,25 @@ def self.sshfs_forward_unmount_folder(machine, opts) protected def self.windows_uninherit_handles(machine) - # For win32-process Process.create, if we pass any file handles to the - # underlying process for stdin/stdout/stderr then all file handles are + # For win32-process Process.create, if we pass any file handles to the + # underlying process for stdin/stdout/stderr then all file handles are # inherited by default. We'll explicitly go through and set all Handles # to not be inheritable by default. See following links for more info - # + # # https://github.com/djberg96/win32-process/blob/6b380f450aebb69d44bb7accd958ecb6b9e1d246/lib/win32/process.rb#L445-L447 # bInheritHandles from https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx - # + # # In 6f285cd we made it so that we would uninherit all filehandles by # default on windows. Some users have reported that this operation # is erroring because `The parameter is incorrect.`. See #52 - # We will make the uninheriting operation best effort. The rationale - # is that if a file handle was not able to be set to uninheritable + # We will make the uninheriting operation best effort. The rationale + # is that if a file handle was not able to be set to uninheritable # then it probably wasn't one that would get inherited in the first place. # - # For each open IO object + # For each open IO object ObjectSpace.each_object(IO) do |io| if !io.closed? - fileno = io.fileno + fileno = io.fileno @@logger.debug("Setting file handle #{fileno} to not be inherited") begin self.windows_uninherit_handle(fileno) @@ -155,7 +155,7 @@ def self.windows_uninherit_handles(machine) def self.windows_uninherit_handle(fileno) # Right now we'll be doing this using private methods from the win32-process - # module by calling For each open IO object. Much of this code was copied from + # module by calling For each open IO object. Much of this code was copied from # that module. We access the private methods by using the object.send(:method, args) # technique. In the future we want to get a patch upstream so we don't need to # access private methods. Upstream request is here: @@ -174,15 +174,15 @@ def self.windows_uninherit_handle(fileno) end # Now clear the HANDLE_FLAG_INHERIT from the HANDLE so that the handle - # won't get shared by default. See: + # won't get shared by default. See: # https://msdn.microsoft.com/en-us/library/windows/desktop/ms724935(v=vs.85).aspx - # + # bool = Process.send(:SetHandleInformation, handle, Process::Constants::HANDLE_FLAG_INHERIT, 0) raise SystemCallError.new("SetHandleInformation", FFI.errno) unless bool end - # Perform a mount by running an sftp-server on the vagrant host + # Perform a mount by running an sftp-server on the vagrant host # and piping stdin/stdout to sshfs running inside the guest def self.sshfs_slave_mount(machine, opts, hostpath, expanded_guest_path) @@ -202,7 +202,7 @@ def self.sshfs_slave_mount(machine, opts, hostpath, expanded_guest_path) # The remote sshfs command that will run (in slave mode) sshfs_opts+= ' -o slave ' - sshfs_cmd = "sudo -E sshfs :#{hostpath} #{expanded_guest_path}" + sshfs_cmd = "sudo -E sshfs :#{hostpath} #{expanded_guest_path}" sshfs_cmd+= sshfs_opts + ' ' + sshfs_opts_append + ' ' # The ssh command to connect to guest and then launch sshfs @@ -225,7 +225,7 @@ def self.sshfs_slave_mount(machine, opts, hostpath, expanded_guest_path) # Log some information @@logger.debug("sftp-server cmd: #{sftp_server_cmd}") @@logger.debug("ssh cmd: #{ssh_cmd}") - machine.ui.info(I18n.t("vagrant.sshfs.actions.slave_mounting_folder", + machine.ui.info(I18n.t("vagrant.sshfs.actions.slave_mounting_folder", hostpath: hostpath, guestpath: expanded_guest_path)) # Create two named pipes for communication between sftp-server and @@ -244,8 +244,8 @@ def self.sshfs_slave_mount(machine, opts, hostpath, expanded_guest_path) # The way this works is by hooking up the stdin+stdout of the # sftp-server process to the stdin+stdout of the sshfs process # running inside the guest in slave mode. An illustration is below: - # - # stdout => w1 pipe1 r1 => stdin + # + # stdout => w1 pipe1 r1 => stdin # />------------->==============>----------->\ # / \ # | | @@ -253,7 +253,7 @@ def self.sshfs_slave_mount(machine, opts, hostpath, expanded_guest_path) # | | # \ / # \<-------------<==============<-----------:sshfs, # :guestpath=>"/sharedfolder", - # :hostpath=>"/guests/sharedfolder", + # :hostpath=>"/guests/sharedfolder", # :disabled=>false # :ssh_host=>"192.168.1.1" # :ssh_port=>"22" @@ -46,7 +46,7 @@ def self.sshfs_reverse_unmount_folder(env, machine, opts) protected - # Perform a mount by running an sftp-server on the vagrant host + # Perform a mount by running an sftp-server on the vagrant host # and piping stdin/stdout to sshfs running inside the guest def self.sshfs_mount(machine, opts) @@ -64,7 +64,7 @@ def self.sshfs_mount(machine, opts) opts[:sshfs_opts] = ' -o noauto_cache '# disable caching based on mtime # Add in some ssh options that are common to both mount methods - opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question + opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question opts[:ssh_opts]+= ' -o ServerAliveInterval=30 ' # send keepalives # SSH connection options @@ -88,12 +88,12 @@ def self.sshfs_mount(machine, opts) # The sshfs command to mount the guest directory on the host sshfs_cmd = "#{sshfs_path} #{ssh_opts} #{ssh_opts_append} " sshfs_cmd+= "#{sshfs_opts} #{sshfs_opts_append} " - sshfs_cmd+= "#{username}@#{host}:#{expanded_guest_path} #{hostpath}" + sshfs_cmd+= "#{username}@#{host}:#{expanded_guest_path} #{hostpath}" # Log some information @@logger.debug("sshfs cmd: #{sshfs_cmd}") - machine.ui.info(I18n.t("vagrant.sshfs.actions.reverse_mounting_folder", + machine.ui.info(I18n.t("vagrant.sshfs.actions.reverse_mounting_folder", hostpath: hostpath, guestpath: expanded_guest_path)) # Log STDERR to predictable files so that we can inspect them @@ -104,7 +104,7 @@ def self.sshfs_mount(machine, opts) # Launch sshfs command to mount guest dir into the host if Vagrant::Util::Platform.windows? - # Need to handle Windows differently. Kernel.spawn fails to work, + # Need to handle Windows differently. Kernel.spawn fails to work, # if the shell creating the process is closed. # See https://github.com/dustymabe/vagrant-sshfs/issues/31 Process.create(:command_line => ssh_cmd, diff --git a/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb b/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb index fadc012..8fdaefa 100644 --- a/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb +++ b/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb @@ -29,7 +29,7 @@ def self.sshfs_reverse_mount_folder(env, machine, opts) # opts contains something like: # { :type=>:sshfs, # :guestpath=>"/sharedfolder", - # :hostpath=>"/guests/sharedfolder", + # :hostpath=>"/guests/sharedfolder", # :disabled=>false # :ssh_host=>"192.168.1.1" # :ssh_port=>"22" @@ -45,7 +45,7 @@ def self.sshfs_reverse_unmount_folder(env, machine, opts) protected - # Perform a mount by running an sftp-server on the vagrant host + # Perform a mount by running an sftp-server on the vagrant host # and piping stdin/stdout to sshfs running inside the guest def self.sshfs_mount(machine, opts) @@ -63,7 +63,7 @@ def self.sshfs_mount(machine, opts) opts[:sshfs_opts] = ' -o noauto_cache '# disable caching based on mtime # Add in some ssh options that are common to both mount methods - opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question + opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question opts[:ssh_opts]+= ' -o ServerAliveInterval=30 ' # send keepalives # SSH connection options @@ -87,12 +87,12 @@ def self.sshfs_mount(machine, opts) # The sshfs command to mount the guest directory on the host sshfs_cmd = "#{sshfs_path} #{ssh_opts} #{ssh_opts_append} " sshfs_cmd+= "#{sshfs_opts} #{sshfs_opts_append} " - sshfs_cmd+= "#{username}@#{host}:#{expanded_guest_path} #{hostpath}" + sshfs_cmd+= "#{username}@#{host}:#{expanded_guest_path} #{hostpath}" # Log some information @@logger.debug("sshfs cmd: #{sshfs_cmd}") - machine.ui.info(I18n.t("vagrant.sshfs.actions.reverse_mounting_folder", + machine.ui.info(I18n.t("vagrant.sshfs.actions.reverse_mounting_folder", hostpath: hostpath, guestpath: expanded_guest_path)) # Log STDERR to predictable files so that we can inspect them @@ -103,7 +103,7 @@ def self.sshfs_mount(machine, opts) # Launch sshfs command to mount guest dir into the host if Vagrant::Util::Platform.windows? - # Need to handle Windows differently. Kernel.spawn fails to work, + # Need to handle Windows differently. Kernel.spawn fails to work, # if the shell creating the process is closed. # See https://github.com/dustymabe/vagrant-sshfs/issues/31 Process.create(:command_line => ssh_cmd, diff --git a/lib/vagrant-sshfs/synced_folder/sshfs_forward_mount.rb b/lib/vagrant-sshfs/synced_folder/sshfs_forward_mount.rb index a495878..b660d30 100644 --- a/lib/vagrant-sshfs/synced_folder/sshfs_forward_mount.rb +++ b/lib/vagrant-sshfs/synced_folder/sshfs_forward_mount.rb @@ -101,7 +101,7 @@ def get_auth_info(machine, opts) if not opts.has_key?(:ssh_password) or not opts[:ssh_password] if not ssh_info.has_key?(:forward_agent) or not ssh_info[:forward_agent] prompt_for_password = true - end + end end # Now do the prompt diff --git a/test/misc/Vagrantfile b/test/misc/Vagrantfile index bed010d..c7c7275 100644 --- a/test/misc/Vagrantfile +++ b/test/misc/Vagrantfile @@ -10,7 +10,7 @@ Vagrant.configure(2) do |config| # https://github.com/dustymabe/vagrant-sshfs/issues/44 config.vm.synced_folder "/etc/", "/sbin/forward_slave_mount_sym_link_test/", type: "sshfs" - # Test a forward normal mount: + # Test a forward normal mount: # mounting a folder from a 3rd party host into guest config.vm.synced_folder "/etc/", "/tmp/forward_normal_mount_etc/", type: "sshfs", ssh_host: ENV['THIRD_PARTY_HOST'],