220 Commits

Author SHA1 Message Date
Mitchell Hashimoto
a30a92bb4f active_machines should return name as a symbol 2012-12-30 11:51:22 -10:00
Mitchell Hashimoto
4c46091746 Environment#primary_machine_name and use it for with_target_vms
This makes the single-provider and default provider semantics work with
primary VMs.
2012-12-30 11:12:56 -10:00
Mitchell Hashimoto
9257fe3d98 Environment#active_machines
This returns a list of active machines for the environment. An active
machine is a machine that at one point was created by Vagrant.
2012-12-27 19:28:05 -10:00
Mitchell Hashimoto
4e649cc987 Upgrade V1-style dotfile to V2
See the code and comments for details on how this is done. As usual, we
are very careful about this so as not to inadvertently destruct real
user data.
2012-12-26 22:41:42 -08:00
Mitchell Hashimoto
c0c3e7bf43 Remove Vagrant::DataStore
We just don't use it yet and the old implementation was sketchy. I was
not happy with it.
2012-12-26 21:45:24 -08:00
Mitchell Hashimoto
3baa31460f Store machine ID in "id" file in data directory.
Instead of storing an "active" hash in the local_data of an Environment,
we now place the ID of a machine in the "id" file of the machine data
directory. This file is read upon re-instantiation in order to load the
proper state.
2012-12-26 21:45:23 -08:00
Mitchell Hashimoto
d18edc3ce5 Detect a V1 environment and stub upgrade process 2012-12-26 21:45:23 -08:00
Mitchell Hashimoto
cc18492c7a Local data path introduced
The local data path is set to the `ROOT_DIR/.vagrant` by default and is
a directory where Vagrant can store environment-local state. This can be
overriden on a per-Environment basis using the `local_data_path`
option.
2012-12-26 21:45:23 -08:00
Mitchell Hashimoto
5cb2f3275a Get rid of a silly constant for subdirs in Environment
The data is only used once anyways so just use a local variable.
2012-12-26 21:45:23 -08:00
Mitchell Hashimoto
e88d735cb6 Make configured VM providers default to an empty one 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto
6478139cee Move config.vm.customize to VirtualBox specific option 2012-12-23 16:29:25 -08:00
Mitchell Hashimoto
ac7958a43b Environment#primary_machine takes a provider argument. Use it. 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
128c06e78d Environment#default_provider 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
2da812bd48 Change log levels of some messages that are useful 2012-12-23 16:29:24 -08:00
Mitchell Hashimoto
c9d5cff7be Add in some logging 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto
819140bbc2 Don't error if box doesn't exist on load 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto
f2b91d26fd Load the configuration per machine, so that provider boxes work
Boxes are provider-specific, and we don't know the provider until
Environment#machine is called, so we need to build up the machine
configuration during this time.
2012-12-23 16:29:23 -08:00
Mitchell Hashimoto
1559f7b7a7 Get rid of the old Environment#vms calls. Use #machine everywhere. 2012-12-23 16:29:23 -08:00
Mitchell Hashimoto
b416665fd7 Just some comments 2012-11-07 22:21:48 -08:00
Mitchell Hashimoto
2ef6ff10f0 Cache the machine objects created in Environment#machine.
Each machine and provider backing should be represented by only one
machine.
2012-11-07 22:08:06 -08:00
Mitchell Hashimoto
67855be77b Add the Environment#machine method
This will eventually replace the Environment#vms method. Because of the
introduction of providers, the environment doesn't know what the backing
of the machines will be (and they're _machines_ now, not _vms_).
Instead, users of Environment will now call `#machine` on the
environment to retrieve a machine with the given backing provider as it
needs it.
2012-11-07 21:45:09 -08:00
Mitchell Hashimoto
81ca275792 Providers to V2 2012-11-06 21:20:55 -08:00
Mitchell Hashimoto
5a33b7ee54 Hosts to V2 2012-11-06 21:20:22 -08:00
Mitchell Hashimoto
c803b0508a Much cleaner plugin part querying syntax.
Before we were manually going over every plugin and getting each piece,
all over the place. Now we have a central manager that will give us all
the pieces we want. There is still some cleanup to do here but this is
much better overall.
2012-11-03 21:25:28 -07:00
Mitchell Hashimoto
6df6f6764f Remove plugin activation. It really isn't necessary.
It was only used in a couple places and it isn't necessary since you can
do the loading within the actual blocks themselves.
2012-11-03 20:29:34 -07:00
Mitchell Hashimoto
2e25285297 Add nice inspect results for Environment and Machine 2012-08-10 00:38:11 -07:00
Mitchell Hashimoto
2ef20586da Remove the action registry feature.
This can be removed since in the future all actions will come from the
providers or something. There are still issues with box actions but
we'll get back to that later...
2012-07-26 21:57:11 -07:00
Mitchell Hashimoto
44b4b9dfef Move drivers to the VirtualBox plugin. Use Machine class.
This starts the transition of replacing VM with Machine. Machine still
isn't ready to fully replace VM but by moving it now, I'm able to find
the spots that need to be fixed. At this point `vagrant status` works
with the new provider interface.
2012-07-24 21:32:38 -07:00
Mark LaPerriere
28e19d5449 Update load_plugins to be more Windows friendly. Uses File::PATH_SEPARATOR instead of hard-coded colon (':'). 2012-07-12 15:25:28 -03:00
Mitchell Hashimoto
623ecb3e3d Environment attempts to upgrade box on config load.
If a V1 box is encountered when Vagrant loads the configuration, then it
will be upgraded on the fly.
2012-07-11 18:36:22 -07:00
Mitchell Hashimoto
da15105a8f Make Box2 the new Box
This involved defaulting all box searching at the moment to VirtualBox.
Additionally, box upgrading is not yet handled. This needs to be done at
some point.
2012-07-11 18:36:21 -07:00
Mitchell Hashimoto
70bdd9f56e Move host base class to a plugin component 2012-06-27 09:26:03 -07:00
Mitchell Hashimoto
9bc1ea5f04 Use config finalize to move some version-specific logic to the version
This moves out the concept of a "default VM" from the Environment class
and makes it the responsibility of the V1 configuration that at least
one VM is defined on it. This lets the configuration ultimately decide
what a "default" implementation is.
2012-06-23 12:48:53 -07:00
Mitchell Hashimoto
7e19d6849b Config loader no longer assumes latest version for procs.
Previously, all procs were assumed to just be the current version. This
is certainly not going to be true always so now the version number of
the configuration must be explicit if you're assigning a proc to the
configuration loader.
2012-06-23 12:06:54 -07:00
Mitchell Hashimoto
b3db82e516 Separate out the versions the config loader knows as init params.
This means that the Config::Loader now only knows how to load
configuration for versions used to initialize the class. This lets
things like the tests be completely isolated from what the actual
configuration is for Vagrant. This will be immensely useful to verify
that the loader functionality works for non-trivial bits (like
upgrading) without depending on Vagrant's upgrading functionality.
2012-06-23 11:33:53 -07:00
Mitchell Hashimoto
51be92eeb6 Remove dependence on V1 Kernel from Environment 2012-06-14 18:46:48 -07:00
Matt Robenolt
db76b42ef5 Allow the .vagrant dotfile to be moved into a completely different directory tree
I wanted to define my dotfile as: `config.vagrant.dotfile_name =
"~/.vagrant-projectname"` and noticed that the full path wasn't
expanded as expected.

This patch allows the vagrant file to be placed anywhere on the
filesystem.
2012-06-09 22:56:54 -07:00
Mitchell Hashimoto
de78a3637a Plugin activation
Vagrant is only guaranteeing that the plugin definition superclass (the
Vagrant.plugin("1") part) is backwards compatible. Anything else, such
as Vagrant::Command::Base and so on, will likely change in future
versions. Beacuse of this, plugins should only immediately expose their
definition.

In order to support loading the other classes, plugins should defer
loading to the "activation" phase of a plugin. This can be done using
the `activated` block:

    class MyPlugin < Vagrant.plugin("1")
      name "my plugin"

      activated do
        require "myplugin/my_command"
      end

      command("foo") { MyCommand }
    end

Plugin activation is done at two specific times:

  * Right when a Vagrant::Environment is created and the global plugins
    (such as from ~.vagrantrc) are loaded.
  * Right before loading configuration, but after the Vagrantfiles have
    been evaluated. This allows plugins to be defined within these files
    as well.
2012-05-21 22:23:50 -07:00
Mitchell Hashimoto
d230f0a41c Environment.rb doesn't need to load in "rubygems" anymore 2012-05-06 13:49:22 -07:00
Mitchell Hashimoto
de92f5217c Use load for the Vagrantrc, make sure it is only loaded once 2012-05-06 10:09:33 -07:00
Mitchell Hashimoto
462136cbf2 Use the .vagrantrc for plugins! 2012-05-05 13:08:07 -07:00
Mitchell Hashimoto
d9034da8a4 Remove gem-based plugin loading 2012-05-05 12:57:31 -07:00
Mitchell Hashimoto
cae80a7716 Make Vagrant::Plugin a module 2012-04-19 21:42:35 -07:00
Mitchell Hashimoto
661f20bb91 Move hosts to a plugin system 2012-04-18 22:20:45 -07:00
Mitchell Hashimoto
a23fee4848 Remove old configuration classes 2012-04-18 17:16:03 -07:00
Mitchell Hashimoto
f8fa859b5f Raise an error if the CWD is incorrect 2012-03-08 16:57:17 -08:00
Mitchell Hashimoto
6969f791ad VAGRANT_CWD can be set to set the CWD of vagrant. 2012-03-08 16:45:19 -08:00
Mitchell Hashimoto
ce00a56ecb Even with a custom vagrantfile name, use defaults [GH-778] 2012-03-08 13:24:04 -08:00
Mitchell Hashimoto
700938b668 Load rubygems in environment.rb [GH-781] 2012-03-07 22:15:45 -08:00
Mitchell Hashimoto
2c823e98bd Fix crashing bug with primary_vm on Environment 2012-02-24 10:27:34 -08:00