Commit Graph

3418 Commits

Author SHA1 Message Date
Chris Roberts d422053fbc Check for vagrant.exe path before validating versions 2017-10-24 16:53:53 -07:00
Vít Ondruch 408bc4e6be Do not use deprecated API. 2017-10-23 10:57:36 -07:00
Vít Ondruch 7187e6f909 Use Integer instead of Fixnum for Ruby 2.4+ compatibility. 2017-10-23 10:57:36 -07:00
Brian Cain 49a569beba Merge pull request #8517 from vbrh-immalle/master
Update is_port_open.rb
2017-09-29 14:47:20 -07:00
Brian Cain ef040f6f82 Merge pull request #8685 from brianjmurrell/patch-1
Clear POSIXLY_CORRECT when using optparse
2017-09-29 14:12:17 -07:00
Brian Cain 3c9e1c9d84 (#8954) Split out cygwin path and ensure bin exists
This commit splits out the msys2 and cygwin path functions for
expanding a path with the cygpath tool. It also ensures that the tool
itself exists when the Which class is called so that it doesn't attempt
to escape slashes on nil.
2017-09-15 10:33:04 -07:00
Chris Roberts fcd1aee9bb Update linux host NFS capability
Add support for systemd detection and using correct method
for starting/checking host nfs service.
2017-09-06 09:54:06 -07:00
Brian Cain f0f60a1075 (#4666) Remove duplicate export folders before writing /etc/exports
Prior to this commit, if you set up multiple folders to export with NFS
on linux with the exact same hostpath, the template used to write
/etc/exports would end up placing the same path with the same IP in
/etc/exports and cause an error preventing the folders from being
properly mounted. This commit fixes that by first looking at which
folders are being exported and if there are any duplicates. If so,
remove the duplicates and only export 1 hostpath folder. If these
duplicate folders have differing nfs linux options, an exception must be
thrown because we cannot assume which options the user intended to
export with.
2017-09-05 16:05:14 -07:00
Brian Cain 085feb6526 (#8923) Quote path passed into IdentityFile for ssh command
Prior to this commit, a change to how the IdentityFile setting for the
ssh command broke when a path with a space was used. This commit fixes
that by quoting the path used to set the IdentityFile so that it uses
the full path instead of part of the path after the space.
2017-08-28 13:14:45 -07:00
Brian Cain b45ee4f455 (#6656) Format windows paths for ssh_config command
Prior to this commit, if the ssh-config command was invoked within
cygwin or msys2, it would show a regular windows style path for private
keys rather than a path that could be used within msys2 or cygwin. This
commit updates that behavior by converting all of the private key paths
to the proper msys2 or cygwin path if the platform is windows and the
command was invoked from one of those two shells.
2017-08-25 13:17:19 -07:00
Brian Cain ea59cfdb92 Merge pull request #8895 from briancain/8697/master/add-ssh-extra-opts
Introduce extra_args setting for ssh configs
2017-08-21 16:26:52 -07:00
Chris Roberts dfefa0883c Merge pull request #8902 from poma/patch-1
Fix #8901
2017-08-21 14:54:52 -07:00
Roman Semenov fc1e4f7533 Fix #8901 2017-08-18 18:58:45 +03:00
Brian Cain ffec0ff8d9 (#8697) Introduce extra_args setting for ssh configs
Prior to this commit, there was no way to add additional ssh arguments
within a Vagrantfile for a given vagrant machine. This commit introduces
a new option extra_args that allows users to pass in a single argument
or an array of flags that will be added onto the ssh command.
2017-08-17 09:02:20 -07:00
Chris Roberts ad5bc23088 Validate powershell prior to powershell use
Adds powershell validation to ensure powershell is available on
the PATH and checks powershell version to ensure meets the
defined minimum powershell version.
2017-07-31 15:05:41 -07:00
Chris Roberts da2c57d3d3 Make best effort to encode to UTF-8. On failure log error and retain original. 2017-07-24 17:04:25 -07:00
Tomoyuki Sakurai 35f83b6fed use '-o IdentityFile=' instead of '-i'
fixes ssh failure when path to the key contains '%'.
2017-07-14 10:34:57 -07:00
Chris Roberts da1b5765c7 Prevent URI parse errors when checking box name
Fixes #8758
2017-07-07 11:43:16 -07:00
Chris Roberts 4ce0ee1a7d Add debug output when detecting provider for environment. 2017-07-06 12:30:57 -07:00
Chris Roberts a55c169691 Merge pull request #8558 from agriffis/provider-priorities
RFC: VAGRANT_PREFERRED_PROVIDERS
2017-07-06 12:30:18 -07:00
Chris Roberts 954569d1fc Remove PATH based cygwin detection
Detecting cygwin via PATH contents can result in false positives
resulting in errors when using Vagrant on Windows outside of a
cygwin shell. Use environment based detection instead.
2017-07-03 14:40:27 -07:00
Chris Roberts f42279508d Reset plugin constraint on update if explicit version set 2017-06-28 07:24:32 -07:00
Chris Roberts a2ce948f91 Merge pull request #8725 from chrisroberts/fix/windows-shellout
Rebuild command and arguments before exec on Windows
2017-06-27 19:39:21 -07:00
Chris Roberts 911340442a Merge pull request #8692 from chrisroberts/update/gem-dep-constraints
Support strict enforcement of internal dependency constraints
2017-06-27 19:37:22 -07:00
Chris Roberts d1a589c59f Merge pull request #8724 from chrisroberts/fix/windows-cwd-check
Set encoding when reading/writing cwd file
2017-06-27 19:21:16 -07:00
Chris Roberts 73d85bd2f7 Support strict enforcement of internal dependency constraints 2017-06-27 19:20:20 -07:00
Chris Roberts f341945a29 Include debug logging of string conversions 2017-06-27 19:10:18 -07:00
Chris Roberts 85d5f11f62 Adjustments to handle plugin updates using proper constraints
If a user provides the gem version using an explicit version or a
constraint, the update action should honor that constraint and not
simply replace it with an unbound constraint.

This also removes system plugin specifications from being matched
and preferred which prevents updates and can result in unexpected
downgrades when running the update.
2017-06-27 19:05:30 -07:00
Chris Roberts 97715280c2 Deep merge plugin list with system plugins. Discard specifications correctly. 2017-06-27 19:05:30 -07:00
Chris Roberts 2575ed9dc2 Explicitly set encodings to prevent incompatible string comparisons 2017-06-26 20:00:43 -07:00
Chris Roberts f3daf5fad7 Rebuild command and arguments before exec on Windows
Flat command can cause issues with arguments. Creating new
string instances from arguments forces common encoding of
all strings used for exec.

Fixes #8690
2017-06-26 20:00:06 -07:00
Chris Roberts 5f955c3d38 Convert atlas references to vagrant cloud 2017-06-23 10:01:51 -07:00
Brian Cain 774e19b152 Disable loading identical Vagrantfile twice from same dir
Prior to this commit, if a user set the env var VAGRANT_HOME to be the
same directory where the project home is, Vagrant would load that file
twice and merge its config. This caused various provisioner and other
provider blocks to unexpectedly run twice. This commit updates the
config loader to look and see if the `:root` and `:home` procs are
equal, and if so, removes the `:home` object so that it isn't loaded and
duplicated. This commit however does not prevent duplicate loading if an
identical Vagrantfile exists in the home and project dir if those
locations are different.
2017-06-22 09:04:21 -07:00
Brian Cain 1b4d7848bc Fix vagrant_cwd warnings
Prior to this commit, if a user ran a vagrant command within a subdir,
it would warn about the cwd changing which is not actually the case.
This commit adds an additional check to see if vagrant is being invoked
within a subdirectory so that it doesn't warn the user.
2017-06-19 13:05:26 -07:00
Brian Cain b02f110cd8 (#7855) Introduce more ssh options for machines
This commit allows the user to configure two additional options that
were previously not configurable: Compression and DSAAuthentication.
Each config option is set as a boolean, and if left out of the config
will default to its previous behavior which is included and set to
"yes". If the user explicitly sets it to false, it will not be included
as an ssh option.
2017-06-15 16:29:53 -07:00
Brian J. Murrell 583fb3c787 Clear POSIXLY_CORRECT when using optparse
In case a user (perhaps inadvertently, or for particular reasons) has POSIXLY_CORRECT
set in their environment, make sure to clear it before calling optparse.optparse!() since
we don't really want POSIXLY_CORRECT argument parsing.
2017-06-14 12:57:10 -04:00
Brian Cain 378aae8782 Merge pull request #8653 from briancain/7188/master/unify-snapshot-restore-failures
Clean up vagrant snapshot restore/delete error messages
2017-06-07 11:47:38 -07:00
Brian Cain 43ae30cf9b Merge pull request #8651 from briancain/WARN-CWD-CHANGES
Warn about changes to cwd for every machine action
2017-06-07 11:46:57 -07:00
Brian Cain 87b7514603 (#7188) Clean up vagrant snapshot restore/delete error messages
This commit adds some better handling around the snapshot restore and
delete commands for the virtualbox provider. If a user attempts to restore from
a vm that does not exist, instead of exiting 0 it will raise an
exception saying the virtual machine has not been created yet.
Addtionally, if a user attempts to restore from a snapshot id that does
not exist, instead of printing a complicated exception from the
virtualbox cli tool, it prints a more useful error message telling the
user that the snapshot does not exist.
2017-06-07 09:12:20 -07:00
Brian Cain 79c7799fd9 Add basic unit test for CWD change warning 2017-06-06 08:38:03 -07:00
Fernando Seror 48b0e00368 Tests regarding warning whenever CWD changes 2017-06-05 13:25:30 -07:00
Fernando Seror 15871a481b Warn about changes to CWD on every machine action
Whenever the path where the machine was first created changes, Vagrant
will now show just one warning when an action is run on the machine.

The idea is that if a user copies the machine over to a different
directory with the idea of running two different machines, this warning
will now help the user determine how to make that work.
2017-06-05 13:25:30 -07:00
Brian Cain 1ade699936 (#6827) Introduce tty flag for ssh command execution
Prior to this commit, if a user ran the `vagrant ssh -c CMD` command, it
would not allow the user to configure pseudo-terminal allocation. This
commit introduces a -t flag for the `vagrant ssh` command which defaults
to true if not specified.
2017-06-02 17:32:02 -07:00
Brian Cain d0f1f39fa6 Merge pull request #8636 from briancain/7118/master/handle-invalid-box-names
Handle box names that are URLs
2017-05-31 16:16:38 -07:00
Brian Cain f1d08aa629 (#7118) Handle box names that are URLs
Prior to this commit, if a user set a URL for the name of a box, vagrant
would not warn the user about using box_url instead. This would lead to
some difficult user experiences around the various box commands due to
the box name being a full URL. This commit introduces a warning to the
user and lets them know to instead use box_url.
2017-05-31 15:25:05 -07:00
Brian Cain eadb0ac831 Raise exception if provider doesn't have snapshot capability
Prior to this commit, if a user attempted to use the `vagrant snapshot
save` or `vagrant snapshot list` commands on a vm whose provider did not
support snapshots, it would simply print a warning. This commit changes
that behavior by instead raising an error.
2017-05-26 15:22:25 -07:00
Brian Cain 6ddba4f7b3 (#7810) Enforce unique snapshot names
Prior to this commit, the vagrant snapshot plugin would save snapshots
with existing names which lead to duplicate snapshot names being saved.
This commit fixes that by checking to see if the given snapshot name
already exists and if so, fails telling the user the given snapshot name
already exists. If a user passes a --force flag, vagrant will first
delete the existing snapshot, and take a new one with the given name.
2017-05-25 16:28:17 -07:00
Chris Roberts 50dd832e63 Include `Which` within Util autoloads 2017-05-12 15:00:55 -07:00
Chris Roberts 6de7c9b445 Only convert path if windows access is granted 2017-05-12 14:14:11 -07:00
Chris Roberts 3c44ce9742 Support vbox provider within WSL rootfs. Make Windows access easier.
Enables proper setup of VMs started from within WSL rootfs paths. Updates
setup for Windows access when working within the WSL to auto-detect settings
instead of relying on user defined environment variables.
2017-05-12 13:11:53 -07:00