Commit Graph

3252 Commits

Author SHA1 Message Date
Seth Vargo 36838d36b7
Fix failing test 2016-07-18 22:38:27 -04:00
Seth Vargo 7ed6bb5bef Merge pull request #7569 from rossi-fi/fix/master/7568
Use RFC- and cURL-friendly file:/// URI. Fixes #7568.
2016-07-18 22:20:03 -04:00
Seth Vargo 581568cf5a Merge pull request #7571 from rossi-fi/fix/master/7570
Strip leading slash left in front of drive letter by uri.path
2016-07-18 22:19:55 -04:00
Seth Vargo 2acaaff801
state_file: fsync and binmode 2016-07-18 21:59:18 -04:00
Seth Vargo ea17ad4530 Merge pull request #7550 from cgwalters/plugin-atomic-rewrite
plugin: Write out state file via create-new-then-rename
2016-07-18 21:58:23 -04:00
Seth Vargo 8f10dbca90 Merge pull request #7587 from alexmv/disabled-conflicts
Skip checking for conflicts on ports that are disabled
2016-07-18 21:55:33 -04:00
Seth Vargo 3b2ffae400
guests/bsd: Print a very descriptive error when mounting vbox folders
BSD-based guests do not support VirtualBox shared folders. This is a
common source of confusion in Vagrant. This new error clearly explains
that this is not a bug in Vagrant and provides instructions on how to 
disable them.
2016-07-18 21:12:58 -04:00
Seth Vargo 7e88266999
guests/linux: Properly escape and retry vbox shared folder mounting 2016-07-18 21:12:57 -04:00
Alex Vandiver 3d2fde9260 Skip checking for conflicts on ports that are disabled
Currently, the supported way (see GH#1922) to disable the default port
2222 port forward is:

    config.vm.network :forwarded_port, guest: 22, host: 2222, disabled: true

However, the port collision detection runs on all ports, regardless of
the `disabled` flag.  This leads it to attempt to connect to port
2222, notice it is taken, and abort with a port conflict -- even
though it will not be attempting to use the port at all.

Skip disabled ports when doing port conflict detection.

A workaround that does not require a Vagrant upgrade to one containing
this fix is to instead set `auto_correct` on the disabled port:

    config.vm.network :forwarded_port, guest: 22, host: 2222, disabled: true, auto_correct: true

This allows the disabled port to be reshuffled off to some other
unused port.
2016-07-14 19:52:38 -07:00
Colin Walters 72c1972181 plugin: Write out state file via create-new-then-rename
This makes updates atomic, so it's useful generally.  However
I'm making this change specifically to support rpm-ostree.

For more information, see:
https://bugzilla.redhat.com/show_bug.cgi?id=1352152
2016-07-12 16:42:24 -04:00
Markus Rossi 4730602ceb Strip leading slash left in front of drive letter by uri.path (see GH-7570). 2016-07-12 15:20:04 +03:00
Markus Rossi 8768d7921d Fix for #7568 Windows drive letter in config.vm.box_url is ignored 2016-07-12 12:01:23 +03:00
Seth Vargo 05aafedc6d
core/bundler: Reset specs in a way that works with new Rubygems 2016-06-20 15:19:21 -07:00
Seth Vargo 23e50c98f9
core/box_collection: Ensure removal
The docs for Ruby say Pathname#rmtree will recursively delete, but
apparently that is a lie, at least on Windows (see GH-7496). Switch to
using FileUtils to ensure the directory is deleted.

Fixes GH-7496
2016-06-20 07:16:08 -04:00
Seth Vargo 177b7784dd
guests/darwin: Allow ipv6 static networks 2016-06-19 12:01:52 -04:00
Seth Vargo 6284a9ac50
guests/bsd: Move NFS mounting logic into shared
A number of the BSD guests used very old mounting options or just
ignored some parameters entirely. This fixes that.

- Closes #7474
- Fixes #7466
2016-06-17 21:04:23 -04:00
Seth Vargo d01ddeeb43
Check stdout instead of process output
Fixes GH-7465
2016-06-16 16:20:15 -04:00
Gilles Cornu 6ee69e3150 Merge pull request #7190 from electrofelix/ansible-parallel-race
Fix a race condition in the concurrent generations of the ansible inventory file, while running `vagrant up --parallel`.

Closes GH-6526
2016-06-09 14:56:03 +02:00
Mikhail Zholobov db3aad3822
Require "vagrant/util/presence" in package action 2016-06-09 13:13:58 +03:00
Karl Isenberg f084fc7d78 Revert 3f9fb2ef03 from GH-2769
- For compatibility with ba77d4b533

Fixes GH-7073
2016-05-31 14:52:43 -07:00
Seth Vargo cf02135290 Merge pull request #7359 from mitchellh/sethvargo/cache_platform
Cache the results of common operations
2016-05-31 11:03:46 -04:00
Seth Vargo 7014aa3bab
Remove custom tempfile class
This is not actually providing any additional utility and also causes
namespace conflicts with people trying to use the real Tempfile class.
2016-05-30 23:21:47 -04:00
Seth Vargo 2a230a11e2
Cache the results of common operations
This commit changes Vagrant::Util::Platform to cache the result of some
common operations. These values are highly unlikely to change over the
course of a single Vagrant run and they are only cached for that run.
2016-05-30 18:27:12 -04:00
Seth Vargo d44fcf2d52
Allow customization of keys_only & paranoid SSH
This adds two new SSH configuration options:

- `keys_only`
- `paranoid`

These values were previously hard-coded, but can now be user-specified.

Fixes GH-4275
2016-05-29 18:03:03 -04:00
Seth Vargo 159e1ec1f1
Use a real file for bundler 2016-05-29 00:41:59 -04:00
Seth Vargo 1b414d3d9e
That file has to exist 2016-05-29 00:18:33 -04:00
Seth Vargo 3d2390fc94
Give a unique, prefixed name to all tempfiles
This commit basically grepped the code base for all uses of Dir.mktmpdir
and Tempfile.new/open and ensures the value is unique within the
code base and also prefixed with `vagrant-`.

Previously, most invocations of these commands simply used "vagrant",
thus making them indistinguishable when trying to identify leaks.
2016-05-28 23:22:34 -04:00
Seth Vargo fb7c4033a9
Do not create a tempfile when downloading box metadata
The only reason we were using Tempfile was to generate the path. This
commit switches to using `Dir::Tmpname.create`, which accomplishes the
same thing without the overhead of creating and removing a tempfile.
2016-05-28 23:22:34 -04:00
Seth Vargo 3a27c29577
Add a new util for generating tempfiles 2016-05-28 23:22:33 -04:00
Seth Vargo cee6e6c7bc
Fix file leaking in bundler 2016-05-28 17:01:59 -04:00
Christian Hofstaedtler ba77d4b533
Allow Vagrant to work with newer Rubygems
Fixes GH-7073
2016-05-27 17:19:33 -04:00
Seth Vargo efdb148f61
Move pre-flight package validation to middleware
This commit separates the scratch and output directory creation from the
main package middleware into its own PackageSetupFolders middleware.
Additionally, the validation that ensures an output file does not exist
is moved into a validation function that can be shared across multiple
methods.

This refactor permits a pre-flight check to ensure box packaging would
be successful before actually stopping the VM.

Fixes GH-7351
2016-05-27 17:07:04 -04:00
Seth Vargo 2a02ceb870
Bump box resume delay to 24h
This commit bumps the box resume delay time to 24h and makes it a
constant because I had a bugger of a time actually finding this in the
code :frowny:.

Fixes GH-7272
2016-05-27 15:18:50 -04:00
Seth Vargo bc74cb4008 Merge pull request #7158 from mitchellh/sethvargo/auth_metadata
Authenticate metadata box urls
2016-04-05 10:46:01 -04:00
Darragh Bailey 36ad4d53cf core: Multi machine use of active_machines requires locking of index
Ensure multi machine access of other machine state information through
iterating `active_machines` and retrieval of cached machines cannot
have multiple threads update the state of machines simultaneously as
this triggers a Machine Lock exception.

Machine state information retrieved from the index, returns a locked
object. Since iteration of active_machine, and retrieval of each
machine from the cache can be triggered by any plugin, it is possible
for another machine to inadvertently access the state and trigger an
update, which the thread owning the machine is currently in the process
of updating it already. This results in a Machine Locked exception
occurring if the attempt to retrieve the cached state from the index
occurs before the other thread calls release.

Partially-Fixes: #6526
2016-03-31 17:27:36 +01:00
Seth Vargo 3305764f71 Rescue Errno::ENOTCONN
Fixes GH-7182
2016-03-31 17:02:50 +02:00
Seth Vargo 42a8ed658e Authenticate metadata box urls 2016-03-19 17:05:43 -04:00
Seth Vargo 27157b5408 Merge pull request #6893 from mmickan/prerelease-version-fix
Prerelease version fix
2016-02-03 09:57:25 -05:00
Seth Vargo 1166800b65 Use SSL and HTTPS links where appropriate 2016-01-25 13:14:54 -05:00
Mark Mickan 1378eebea9 Use pristine version string when constructing path to box
Without this change, the version string may be mutated when passed through
Gem::Version.new(version).to_s before being used to construct the box
directory.  This is a problem when using prerelease version numbers because,
for example, it will look for "~/.vagrant.d/boxes/1.0.0.pre.alpha.1" when it
should be looking for "~/.vagrant.d/boxes/1.0.0-alpha.1".
2016-01-20 10:22:00 +10:30
Mitchell Hashimoto cf4b03d701 core: do not convert drive letters to UNC paths [GH-6598] 2015-12-24 12:36:14 -08:00
Mitchell Hashimoto 0de44a116b core: use env var for bundle retries [GH-6705] 2015-12-24 12:16:12 -08:00
Mitchell Hashimoto 06a1461081 Merge pull request #6662 from lukebakken/fixes/lrb/gh-4503-hyper-v-admin-privs
Fix for 4503
2015-12-14 15:56:55 -08:00
Mitchell Hashimoto 884782f3ce Merge pull request #6603 from mitchellh/sethvargo/cleanup_output
Only run cleanup tasks when they are defined on the provisioner
2015-12-14 15:41:17 -08:00
Mitchell Hashimoto 739d29e8fa Merge pull request #6612 from reedloden/virtualbox-checksum
Add checksum validation for the VirtualBox installs on Windows and OS X
2015-12-14 15:39:46 -08:00
Luke Bakken 57187c9f88 Add method to detect if a Windows user is a member of the "Hyper-V Administrators" group.
Modify Hyper-V provider to require a user to either be an Administrator or a member of "Hyper-V Administrators"
2015-12-10 07:04:39 -08:00
Seth Vargo 4e21dd78e4 Ignore case when comparing checksums
Fixes GH-6648
2015-12-07 10:30:46 -05:00
Mitchell Hashimoto 30d9e243bb fix failing tests 2015-12-02 18:03:08 -08:00
Mitchell Hashimoto 5c4e71e317 core: machine output provider info for the machine 2015-12-02 13:06:07 -08:00
Mitchell Hashimoto cee517d963 core: fix machine readable UI to contain target and have proper format 2015-12-02 13:06:07 -08:00