Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documents when using private_network with dhcp #3349

Closed
wants to merge 1 commit into from
Closed

Fix documents when using private_network with dhcp #3349

wants to merge 1 commit into from

Conversation

tobynet
Copy link

@tobynet tobynet commented Mar 28, 2014

I wrote in my Vagrantfile following the documents as follows :

  config.vm.provider "virtualbox" do |vb, override|
    override.vm.network "private_network", type: "dhcp"
  end

πŸ˜„πŸ˜„πŸ˜„ Expected πŸ˜„πŸ˜„πŸ˜„

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: VirtualBox VM is already running.
$ # No problem

πŸ’©πŸ’©πŸ’© Actual πŸ’©πŸ’©πŸ’©

$ vagrant up
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* An IP is required for a private network.
$ echo $?
1

😱 πŸ’”

Next, I correct my Vagrantfile as follows:

  config.vm.provider "virtualbox" do |vb, override|
    override.vm.network "private_network", type: :dchp
  end

Then,

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: VirtualBox VM is already running.
$ # No problem

✌️✌️✌️

❓ ❓ ❓ Why should I fix it as this patch ❓ ❓ ❓

See below:

at https://github.com/mitchellh/vagrant/blob/v1.5.1/plugins/providers/virtualbox/action/network.rb#L279 :

if options[:type] == :dhcp

at https://github.com/mitchellh/vagrant/blob/v1.5.1/plugins/providers/virtualbox/action/network.rb#L251 :

          options[:ip] = "172.28.128.1" if options[:type] == :dhcp && !options[:ip]

@mitchellh
Copy link
Contributor

We convert to a symbol up here: https://github.com/mitchellh/vagrant/blob/v1.5.1/plugins/providers/virtualbox/action/network.rb#L248

This was a separate issue I just fixed.

@tobynet
Copy link
Author

tobynet commented Apr 2, 2014

LGTM

πŸ‘ πŸ‘Ž

@tobynet tobynet deleted the patch-1 branch April 2, 2014 05:07
@ghost ghost locked and limited conversation to collaborators Apr 12, 2020
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.

None yet

2 participants