Commit Graph

415 Commits

Author SHA1 Message Date
Chris Roberts fc5ceafbcf Only generate notice once 2018-02-22 14:49:44 -08:00
Chris Roberts f2bf18e56b Update behavior of the authentication middleware
Always remap old hosts to target host when encountered. When custom
vagrant server is defined, warn when tokens may be attached and allow
time for user to cancel.

Fixes #9442
2018-02-21 17:03:38 -08:00
Chris Roberts 58f66ac8ce Add full checkpoint integration 2018-01-16 14:16:49 -08:00
Brian Cain 11ddd0136d
(#9044) Show all box providers in command outdated
Prior to this commit, when the `--global` flag was used with the
`vagrant box outdated` command, it would ignore box providers and not
inform the user of all outdated boxes. This commit fixes that by
displaying each box within the users environment, and includes the
provider of the box in the message.
2018-01-08 09:43:28 -08:00
Brian Cain c9e5a22bff (#9062) Deprecate :paranoid in favor of :verify_host_key
As of `net-ssh` version 4.2.0, the key :paranoid has been deprecated in
favor of using :verify_host_key. This commit updates Vagrants ssh config
to use the new key, and deprecates the use of :paranoid.
2018-01-05 10:02:45 -08:00
Brian Cain b9581ed213
Merge pull request #9251 from briancain/9137/master/exit-0-destroy-not-created
Exit 0 if vagrant destroy finds no running vms
2017-12-20 16:42:36 -08:00
Brian Cain d4d4ed6473 (#9137) Exit 0 if vagrant destroy finds no running vms
This commit reverts the behavior of `vagrant destroy` to exit 0 if no
running vms were found when the destroy command is run.
2017-12-14 12:48:22 -08:00
Chris Roberts 3a5729015a Add documentation entry for init command --template flag 2017-12-13 15:59:45 -08: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
Zachary Flower 14d596f08e Add --template option to init command, with graceful fallback to default Vagrantfile template behavior 2017-11-17 11:30:10 -07:00
Justin Campbell 40d8dc4582 Add app.vagrantup.com to allowed auth hosts
This should allow users setting VAGRANT_SERVER_URL to app.vagrantup.com to authenticate to private boxes.
2017-11-07 10:35:16 -05:00
Justin Campbell c5266e98b8 Change allowed auth hosts to list 2017-11-07 10:32:33 -05:00
Brian Cain 8be2ae8e6a Add unit test for destroy command 2017-11-01 15:30:59 -07:00
Brian Cain d8bffd201f Add delay for parallel destroy without force, restructure state checking
This commit adds better messaging to the user if the parallel flag is
used without the force flag. It also makes the state checking based on
the delta between the initial and final states of the guests due to the
fact that there is no guarantee what the "destroyed" state id will be
between providers.
2017-10-31 13:52:07 -07:00
Brian Cain 2d7858ff8a Introduce parallel destroy for certain providers
This commit introduces parallel destroy using the batch action class for
the destroy command.
2017-10-31 11:29:40 -07:00
Justin Campbell f8fa7e3b29 command/login: Fix typo in server_error 2017-08-30 10:39:58 -04:00
Justin Campbell 3ddc98c2e4 command/login: Support 2FA login on Vagrant Cloud 2017-08-30 10:39:58 -04:00
Justin Campbell 0e091fee16 command/login: Store user/pass on client
Will allow us to prompt for other info without forgetting this data.
2017-08-30 10:39:58 -04: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 d9e088ba5d (#8479) Disable install providers when using global id on vagrant up
Prior to this commit, when using a global id to bring up a vagrant vm,
vagrant would fail during the "install provider" step due to the fact
that the global vagrant machine was not configured for the local vagrant
environment. Since this global vm exists elsewhere, we disable the
install provider step so that vagrant can just bring up the global
vagrant machine.
2017-08-22 10:08:05 -07:00
Brian Cain 4bd95cbfe2 (#8864) Improve `vagrant validate` command
Prior to this commit, the `vagrant validate` command would only validate
the first machine in a vagrant file. This commit improves that by
validating all known machines in the environment. If one is not found,
it will properly throw an exception instead of a stacktrace.
2017-08-15 13:53:45 -07:00
Brian Cain 335aa35ff4 Merge pull request #8871 from briancain/8719/master/add-force-flag-for-update
Add force flag for box upgrade command
2017-08-14 08:49:46 -07:00
Justin Campbell 03ebd8b714 command/login: Add hostname to default token desc
Uses `Socket.gethostname` to add the current hostname to the default
description.
2017-08-10 17:21:20 -04:00
Justin Campbell 92578aed4b command/login: Add description to created token
This adds a prompt for a token description, which is now supported in
Vagrant Cloud. Pressing enter on the prompt uses the default description
of `"Vagrant login"`.

    $ vagrant login
    In a moment we will ask for your username and password to HashiCorp's
    Vagrant Cloud. After authenticating, we will store an access token locally on
    disk. Your login details will be transmitted over a secure connection, and
    are never stored on disk locally.

    If you do not have an Vagrant Cloud account, sign up at
    https://www.vagrantcloud.com

    Vagrant Cloud Username: justincampbell
    Password (will be hidden):
    Token description (Defaults to "Vagrant login"):
    You are now logged in.
    $

Which created a token with the default description of "Vagrant login":

![](http://c.justincampbell.me/2V0p0T0U0d0O/Screen%20Shot%202017-08-10%20at%205.08.21%20PM.png)

Entering a description:

    Token description (Defaults to "Vagrant login"): Justin's MacBook Pro

![](http://c.justincampbell.me/2m1N0d1M3k3P/Screen%20Shot%202017-08-10%20at%205.09.39%20PM.png)
2017-08-10 17:12:38 -04:00
Brian Cain 324a08bd75 (#8719) Add force flag for box upgrade command
Prior to this commit, if a state was reached where the action_box_add
command needed a force flag, it would fail requesting the user to
provide that flag to override adding a new box. However that flag did
not exist on the box update command, and could not be passed onto the
action_box_add action. This commit updates that to include a force flag,
and if used, pass that value onto the action_box_add action.
2017-08-09 16:21:13 -07:00
Chris Roberts 5f955c3d38 Convert atlas references to vagrant cloud 2017-06-23 10:01:51 -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 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 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 39606e833f Update method documentation to correctly describe method 2017-05-09 09:13:14 -07:00
Chris Roberts df069deac0 Validate plugin sources and report errors if detected. 2017-04-04 17:53:04 -07:00
Gökhan Şengün 51a15d23bd Correct box version sorting of box list command.
Boxes are already correctly sorted as a result of PRs #7956 and #8334. The extra sort here breaks.
2017-03-29 00:56:42 +03:00
Chris Roberts 256ce3b0d5 Merge pull request #8264 from hasyimibhar/command-validate
Add validate command
2017-03-23 09:52:12 -07:00
Chris Roberts e7abd1114b Merge pull request #8393 from chrisroberts/fix/default-provider-env-var
Prevent other provider install attempts when explicit provider given
2017-03-23 09:35:59 -07:00
Chris Roberts 72d0eb497d Isolate push deprecation to atlas strategy only 2017-03-21 15:08:17 -07:00
Chris Roberts 7c4252e24a Prevent other provider install attempts when explicit provider given 2017-03-21 10:58:06 -07:00
Chris Roberts e1e3df68da Merge pull request #7967 from apupier/removeRequirementsOnPathWithoutSpace
Remove requirements on path without space as issue was fixed in Ruby
2017-03-06 09:08:06 -08:00
Chris Roberts 60cd9057a7 Add command deprecation module to push 2017-02-24 06:47:44 -08:00
Hasyimi Bahrudin cbda9f0906 Add validate command for validating Vagrantfile 2017-02-07 13:43:49 +08:00
Chris Roberts 4bbd43c73f Display default on expunge command questions. Prompt user on invalid input. 2017-01-12 07:16:57 -08:00
Raymond P. Burkholder 30ea15994a Update command.rb
Issue #8159

while using:
$ vagrant package --base ${VIRTUALBOXNAME}

this error occurs:

/usr/share/rubygems-integration/all/gems/vagrant-1.9.0/plugins/commands/package/command.rb:59:in `package_base': uninitialized constant VagrantPlugins::CommandPackage::Command::SecureRandom (NameError)
Did you mean?  SecureRandom
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/plugins/commands/package/command.rb:42:in `execute'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/lib/vagrant/cli.rb:42:in `execute'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/lib/vagrant/environment.rb:274:in `cli'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.0/bin/vagrant:118:in `<top (required)>'
        from /usr/bin/vagrant:22:in `load'
        from /usr/bin/vagrant:22:in `<main>'
2016-12-28 19:02:13 -04:00
Alvaro Miranda Aguilera 06271f55c6 Show comma separated include 2016-12-10 21:56:21 +01:00
Bjorn Brala 457c58fe71 Mention `--base` option is VirtualBox only in package command. 2016-12-08 21:22:24 +01:00
Chris Roberts cc37207f9c Update key names when passing to install action 2016-11-28 16:56:00 -08:00
Chris Roberts b0a3cfa978 Provide error information on plugin repair error.
Also includes original exception information within logger output.
2016-11-28 07:48:16 -08:00
Chris Roberts d9c1c36b3c Iterate plugin list using manager result to retain sorting 2016-11-21 09:25:56 -08:00
Chris Roberts 23b40a31ed Skip reinstallation of system plugins 2016-11-17 16:40:30 -08:00
Chris Roberts ae21c31a6c Use Manager#installed_plugins information to display updates 2016-11-16 13:27:05 -08:00
Chris Roberts 1806cc1c5c Remove deprecated plugin install option 2016-11-11 15:13:03 -08:00