291 Commits

Author SHA1 Message Date
grahamhub
bfa73b06c6 cli: implement --info flag for package #12191 2021-04-15 00:28:41 -05:00
Chris Roberts
2d019cb608 Provide specialized messages on plugin install failure if possible
Inspect the error message received when failing to install a
    plugin. If it's something we can determine the cause, send
    back a cleaner error message to the user on how to resolve.
2021-03-08 15:57:13 -08:00
Chris Roberts
5003bb6e15 Updates to address all Ruby deprecations and warnings
This includes updates for resolving all warnings provided by Ruby
for deprecations and/or removed methods. It also enables support
for Ruby 2.7 in the specification constraint as all 2.7 related
warnings are resolved with this changeset.
2020-08-10 13:05:41 -07:00
Sophia Castellarin
bedd141381
Merge pull request #11721 from jbonhag/f/ssh-nil-exit-status
Raise an error on nil exit status
2020-08-07 10:55:58 -05:00
sophia
a1d429a4e8 Raise more descriptive error if cloud init fails 2020-08-06 15:47:36 -05:00
sophia
0a5a940e58 Raise an error if cloud-init is not found on guest 2020-07-29 12:50:50 -05:00
Jeff Bonhag
ff9f9c40e8
Differentiate between controller "not found" errors
This commit adds a new error message to be raised if a VM has no
supported storage controllers. This lets us differentiate between two
different "controller not found" scenarios:

1. If we are looking for a controller that we're expecting to find (i.e.
one that was recorded in the disk metadata file)
2. If we are poking around for the *best* controller to use in a
configuration task
2020-07-09 15:10:50 -04:00
Jeff Bonhag
c9bdcb6839
Error on unsupported storage controller type 2020-07-09 15:07:49 -04:00
Jeff Bonhag
1e6eb0d636
Raise an error if primary disk can't be found 2020-07-09 15:07:49 -04:00
Jeff Bonhag
3a515cc7d6
Error if the required storage controller not found
This commit adds a new error type that can be raised whenever a storage
controller of the required type is not found. This indicates that a user
needs to either add the storage controller manually or change their disk
configuration.

It also removes the last hardcoded instance of "SATA Controller" as a
default argument.
2020-07-09 15:07:48 -04:00
Sophia Castellarin
02ef62dcff
Merge pull request #11694 from soapy1/host-cap-build-iso
Build iso for Darwin host
2020-07-07 10:29:52 -05:00
Brian Cain
42718437ab
Initial commit of cloud_init setup action
This commit introduces a new builtin action for preparing and
configuring guests cloud_init configs as an iso to be attached later by
the disk actions
2020-06-29 11:00:16 -07:00
Jeff Bonhag
9af48e5764
Raise an error on nil exit status
This commit changes the SSH communicator to raise an error if Vagrant
doesn't receive an exit status from an SSH command, for example if the
command is terminated by the OOM-killer.
2020-06-26 13:25:59 -04:00
sophia
e1d104a8e3 Build iso for Darwin host 2020-06-15 09:55:15 -05:00
Chris Roberts
5195bee9ea Check if plugin install provides specification
During a plugin install, if the plugin is already installed and
activated, no specification will be returned as there was nothing
new installed. In this situation, look for the requested plugin
within the activated specifications. If it is found, then proceed
since the plugin is installed. If it is not found, return an error.
2020-05-06 15:51:37 -07:00
sophia
538ee948ee Choose netplan renderer based on network config and available tools 2020-04-10 17:17:04 -04:00
Jeff Bonhag
6d228becf9
Raise an error if host IP is not found 2020-03-19 17:16:21 -04:00
Chris Roberts
21e5913cef Explicitly activate vagrant specification when not activated 2020-03-10 15:08:56 -07:00
Brian Cain
2176216bf8
Add error for when disks defined are greater than the max limit 2020-02-10 12:58:11 -08:00
Jeff Bonhag
d7a5f74897
Fixes #11128: Error if machine folder inaccessible (#11239)
This commit catches the Errno::EPERM raised by the operating system if
the machine folder is inaccessible and displays it as a more friendly
error message.

This can be an issue on macOS Catalina if virtual machine files are kept
in a special directory (Documents/Downloads/Desktop) that Vagrant's
embedded Ruby is not allowed to access.
2019-12-17 12:41:12 -05:00
Brian Cain
16b5ad74ca
Handle command triggers with run_remote options
This commit adds some handling around when a machine does not exist at
all but a trigger was defined with a run_remote option
2019-02-01 13:34:15 -08:00
Chris Roberts
818d1d97ae Update rsync auto post command error handling to be more generic
Rescue and re-wrap any errors encountered when running the post
rsync capability. Rescue this exception type and notify of error
when encountered by rsync auto. Include test coverage.
2018-12-18 09:50:21 -08:00
hieptranquoc
480e992ea1 @ #10460 | vagrant rsync should restart when rsync find chown command error 2018-12-18 09:49:44 -08:00
Brian Cain
6d4d9b9304
Fixes #10432: Validate that provider file exists prior to upload
Prior to this commit, Vagrant would attempt to path expand a file that
didn't exist if it was left out of the passed in arguments and no
`--url` was used for external box uploading. This commit fixes that by
adding some additional validation for the passed in box file.
2018-11-30 14:13:45 -08:00
Brian Cain
b1b829f69d
Fix missing end in errors class 2018-10-12 09:16:36 -07:00
Brian Cain
83bd592e30
Introduce curl helper and uploader classes
This commit introduces a new uploader class for uploading files and
splits up some commonly used functionality between it and the downloader
class into a curl helper library.
2018-10-12 09:07:10 -07:00
Chris Roberts
48d358adcb Add winrm and upload commands 2018-10-04 13:26:41 -07:00
Chris Roberts
40f4e6f67e Vagrant Environment isolated plugins
Adds support for plugins isolated to a specific `Vagrant::Environment`
which can be managed by the vagrant plugin command using the the
--local flag.
2018-07-17 14:49:41 -07:00
Brian Cain
52c3dcc70e
(#9997) Catch and allow for non-standard exit codes
Prior to this commit, the run trigger option wouldn't catch for failures
outside of the #Subprocess.execute raising exceptions. This commit fixes
that by inspecting the exit code result of the subprocess and using the
new `exit_codes` option to determine how to move forward with the
trigger.
2018-07-09 15:56:26 -07:00
Brian Cain
5ca382727d
Raise error if argument is provided with --all-global flag
This commit raises an error if additional arguments are provided to the
suspend command when the `--all-global` flag is used.
2018-05-11 15:43:14 -07:00
Stefan Scherer
f14e8bcbf2
Allow other providers in WSL 2018-05-02 22:36:17 +02:00
Brian Cain
fd3d78746c
(#9717) Improve messaging around not finding requested provider
This commit adds a bit more helpful messaging for the user when asking
for a provider that might not exist or does not follow the correct
casing. If it can find a match on a provider it knows about, it will
suggest it.
2018-04-26 09:43:58 -07:00
Brian Cain
0054c5aae6
Raise error if incomplete trigger block is defined 2018-04-20 10:51:38 -07:00
Brian Cain
600557ff24
Move strings to translation file 2018-04-20 10:51:38 -07:00
Chris Roberts
f3c5e86f28
Merge pull request #9504 from zachflower/feature/vagrant-aliases
Vagrant aliases
2018-04-06 15:39:18 -07:00
Sergii Bondarenko
62740e2240 #9298: Increase stability of determination of a current WSL instance 2018-02-28 10:08:01 -08:00
Zachary Flower
f46ebf5240 throw an exception when whitespace is found within an alias keyword 2018-02-16 13:28:57 -07:00
Brian Cain
e8708232a5
(#9258) Exit if Hyper-V is enabled and VirtualBox provider is used
This commit adds a function on windows for the VirtualBox provider to
check if Hyper-V is enabled. If so, exit and display a warning to the
user that going forward will result in a system crash.
2018-02-08 11:20:41 -08:00
Chris Roberts
81cbdae62a Make powershell error generalized 2017-12-21 09:55:19 -08:00
Brian Cain
0d7ad9f18f
Merge pull request #9275 from zachflower/validate_ip_addresses
Add a clean error message for invalid IP addresses
2017-12-15 11:22:03 -08:00
Brian Cain
144c402f3b
Merge pull request #9252 from briancain/9055/master/pretty-print-nameerror-exceptions
Print more helpful error message for NameEror exceptions
2017-12-15 09:19:26 -08:00
Brian Cain
627babe15e (#9055) Print more helpful error message for NameEror exceptions
This commit adds some additional handling for when Vagrant loads config
files. Instead of showing the basic ruby exception, it prints a more
helpful error message and tries to direct the user to the line number
and file where the exception is occuring.
2017-12-14 15:31:48 -08:00
Zachary Flower
4a4183398b Add a clean error message for invalid IP addresses 2017-12-14 14:57:21 -07:00
Zachary Flower
abb1149190 Raise an exception when the template cannot be found, and update tests accordingly 2017-11-17 12:20:03 -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
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
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
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
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