Skip to content
This repository has been archived by the owner on Aug 20, 2019. It is now read-only.

Allow empty config files. #91

Merged
merged 1 commit into from
Feb 3, 2016
Merged

Allow empty config files. #91

merged 1 commit into from
Feb 3, 2016

Conversation

thom8
Copy link
Member

@thom8 thom8 commented Feb 1, 2016

Currently if a config files exists but has no YAML vars defined vagrant will error.

@@ -7,8 +7,8 @@ Vagrant.require_version '>= 1.8.0'

cwd = File.dirname(File.expand_path(__FILE__))
config_dir = '.beetbox/'
vagrant_config = "#{cwd}/#{config_dir}config.yml"
local_config = "#{cwd}/#{config_dir}local.config.yml"
project_config = "#{dir}/#{config_dir}config.yml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regression error, changing back to dir which is not set will cause this Vagrantfile to break.

@thom8
Copy link
Member Author

thom8 commented Feb 1, 2016

Updated to use cwd

@Decipher
Copy link
Contributor

Decipher commented Feb 1, 2016

Code looks good, will have to run a few manual tests to confirm for sure though.

@Decipher
Copy link
Contributor

Decipher commented Feb 2, 2016

Missed a change on line 23; Still references vagrant_config and therefore the Vagrantfile fails.

@Decipher
Copy link
Contributor

Decipher commented Feb 2, 2016

Should also make these changes to the box Vagrantfile.

@thom8 thom8 force-pushed the empty_conf branch 3 times, most recently from 56bf93d to 254ced3 Compare February 2, 2016 01:05
@thom8 thom8 force-pushed the empty_conf branch 2 times, most recently from 31c371b to 04a9b8e Compare February 2, 2016 11:51
@thom8
Copy link
Member Author

thom8 commented Feb 2, 2016

Updated box Vagrantfile - having both of these in the project will make it really difficult/confusing for any new contributors, we should look at tidying it up ASAP -- #94

The Vagrantfile's should be exactly the same except for the skip conditions for the box version.

@Decipher
Copy link
Contributor

Decipher commented Feb 2, 2016

This PR doesn't 100% resolve the issue, due to the definition of 'empty'.

If I have a .beetbox/config.yml file with absolutely nothing in the file it does not work, it throws the following error:

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by

a syntax error.

Path: /Users/stuartclark/Documents/Projects/beetbox/Vagrantfile
Line number: 31
Message: TypeError: no implicit conversion of false into Hash

However, if the .beetbox/config.yml file has --- in the file it does work.

I assume the completely empty file is not a valid YAML file, but it seems more likely to be the case than a valid empty YAML config file.

Decipher added a commit to Decipher/beetbox that referenced this pull request Feb 2, 2016
Decipher added a commit that referenced this pull request Feb 3, 2016
Allow empty config files.
@Decipher Decipher merged commit 07a257a into beetboxvm:dev Feb 3, 2016
@thom8 thom8 deleted the empty_conf branch February 3, 2016 03:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants