Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

vagrant halt [id] causes "warning: already initialized constant VAGRANTFILE_API_VERSION" #839

Merged
merged 1 commit into from
Aug 5, 2016

Conversation

joestewart
Copy link
Contributor

When using the id argument for vagrant halt to act on a vagrant installation in a different directory a warning is currently generated. This is due to the VAGRANTFILE_API_VERSION already being define. This PR checks if it has been defined.

Warnings -

Vagrantfile:3: warning: already initialized constant VAGRANTFILE_API_VERSION
Vagrantfile:3: warning: previous definition of VAGRANTFILE_API_VERSION was here

@geerlingguy
Copy link
Owner

When building a Vagrantfile.local or a separate 'delegate' Vagrantfile, what's the rationale for defining VAGRANTFILE_API_VERSION in there as well? If it makes sense to support the constant definition in multiple places, I'm okay with this... I just haven't run into this issue before and am wondering about the use case.

@joestewart
Copy link
Contributor Author

The use case is when multiple DrupalVM installations are running.

vagrant global-status lists the id's of the vm's

From directory of vm1.

vagrant halt with id's of vm 2,3,4 etc. to shut them down without changing directories.

So not really about a delegating Vagranfile or Vagrantfile.local.

Sorry not more clear, https://www.vagrantup.com/docs/cli/halt.html doesn't describe the id argument.

@thom8
Copy link
Collaborator

thom8 commented Aug 1, 2016

You can use Vagrant.configure("2") do |config| as there's currently no logic to switch version compatibility.

https://www.vagrantup.com/docs/installation/backwards-compatibility.html

@morsok
Copy link

morsok commented Aug 4, 2016

I'm also encountering this warning quite often, the check seems harmless and would help with that thank you !

@geerlingguy geerlingguy merged commit fd76bb0 into geerlingguy:master Aug 5, 2016
@geerlingguy
Copy link
Owner

Sounds good then!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants