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 an exception when the host is not connected to host-only interface #268

Merged
merged 2 commits into from
Jul 11, 2016

Conversation

legal90
Copy link
Collaborator

@legal90 legal90 commented Jul 11, 2016

Similarly to the problem described in #266, Host-Only interfaces could be also not connected to the host machine, so it causes an exception when Vagrant tries to parse its IP:

       stderr: /Users/legal/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/bundler/gems/vagrant-a4f45a18a653/lib/vagrant/util/network_ip.rb:35:in `ip_parts': undefined method `split' for nil:NilClass (NoMethodError)
        from /Users/legal/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/bundler/gems/vagrant-a4f45a18a653/lib/vagrant/util/network_ip.rb:19:in `network_address'
        from /Users/legal/Documents/vagrant-parallels/lib/vagrant-parallels/action/network.rb:454:in `block in hostonly_find_matching_network'
        from /Users/legal/Documents/vagrant-parallels/lib/vagrant-parallels/action/network.rb:449:in `each'
        from /Users/legal/Documents/vagrant-parallels/lib/vagrant-parallels/action/network.rb:449:in `hostonly_find_matching_network'
        from /Users/legal/Documents/vagrant-parallels/lib/vagrant-parallels/action/network.rb:323:in `hostonly_adapter'
        from /Users/legal/Documents/vagrant-parallels/lib/vagrant-parallels/action/network.rb:92:in `block (3 levels) in call'
        from /Users/legal/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/bundler/gems/vagrant-a4f45a18a653/lib/vagrant/environment.rb:561:in `lock'
        from /Users/legal/Documents/vagrant-parallels/lib/vagrant-parallels/action/network.rb:91:in `block (2 levels) in call'
        from /Users/legal/Documents/vagrant-parallels/lib/vagrant-parallels/action/network.rb:89:in `synchronize'
        from /Users/legal/Documents/vagrant-parallels/lib/vagrant-parallels/action/network.rb:89:in `block in call'
        from /Users/legal/Documents/vagrant-parallels/lib/vagrant-parallels/action/network.rb:75:in `each'
        from /Users/legal/Documents/vagrant-parallels/lib/vagrant-parallels/action/network.rb:75:in `call'

This PR fixes that error by an additional check.
Also, I've removed fetching DHCP details from driver's method #read_host_only_interfaces, because it is actually not needed for Network action.

@legal90 legal90 merged commit 1616512 into Parallels:master Jul 11, 2016
@legal90 legal90 deleted the fix-network branch July 11, 2016 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant