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 a bug can be occurred when instance returns nil #285

Merged
merged 2 commits into from
Feb 13, 2017

Conversation

Kuniwak
Copy link
Contributor

@Kuniwak Kuniwak commented Feb 13, 2017

I got the following error message (full error message) when executing kitchen list:

$ kitchen list
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ClientError
>>>>>> Message: Could not load the 'vagrant' driver from the load path. Please ensure that your driver is installed as a gem or included in your Gemfile if using Bundler.
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

This message said that "kitchen-vagrant was not installed," but kitchen-vagrant was listed by bundle list and require("kitchen/driver/vagrant.rb") did not raise LoadError.

I think this problem is caused by e788314. After this commit, the error undefined method `name' for nil:NilClass can be occurred when instance returns nil, because instance.name is accessed before nil check for instance.

@Kuniwak Kuniwak changed the title Fix a bug Fix a bug can be occurred when instance returns nil Feb 13, 2017
@cheeseplus
Copy link
Contributor

Thanks for the catch and the added test, I was moving things around for the style checker but I can see how that would have broken it.

@cheeseplus cheeseplus merged commit f3226e7 into test-kitchen:master Feb 13, 2017
@Kuniwak Kuniwak deleted the care-nil-instance branch February 13, 2017 16:28
@Kuniwak
Copy link
Contributor Author

Kuniwak commented Feb 13, 2017

Thank you for the quick response!

@cheeseplus
Copy link
Contributor

As soon as I saw the code and your explanation I realized that while it passed the tests, it's only because we weren't testing for that specific condition. I'll get a 1.02 release out ASAP.

@cheeseplus
Copy link
Contributor

1.0.2 is released and thanks again @Kuniwak

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.

2 participants