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

Hyper-V: Ensure default switch name is always wrapped in quotes #345

Merged
merged 1 commit into from
Feb 22, 2018

Conversation

stuartpreston
Copy link

Signed-off-by: Stuart Preston [email protected]

On a Windows 10 (build 16299) machine, the name of the default Hyper-V switch is Default Switch. If the switch is specified in the .kitchen.yml as per the documentation (see below example) then there is no issue with the generated Vagrantfile:

  network:
  - ["public_network", bridge: "Default Switch"]

However, when the default configuration is used without specifying the above, the following entry is generated in the Vagrantfile:

c.vm.network(:public_network, bridge: Default Switch)

In turn this leads to Vagrant not being able to validate the file correctly, returning the following error:

Vagrantfile:6: syntax error, unexpected tCONSTANT, expecting keyword_do or '{' or '('
       etwork, bridge: Default Switch)
                              ^
Vagrantfile:15: syntax error, unexpected keyword_end, expecting end-of-input

This PR ensures that any default switch name returned from the system is wrapped in quotes, generating a valid Vagrantfile.

@cheeseplus cheeseplus merged commit c05402d into master Feb 22, 2018
@tas50 tas50 deleted the sp/fix-hyperv-defaults branch January 30, 2022 00:59
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