-
Notifications
You must be signed in to change notification settings - Fork 25
master branch: "formal argument cannot be a constant" #91
Comments
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
hm. Are you sure about the provider name you're using ? I don't remember reading that there was 'VBox' as provider for VirtualBox. I've always seen 'virtualbox' as provider name. If 'VBox' comes from the line:
of the As regards the error message, I'm going to modify the Vagrantfile template avoid that, in case some day a vagrant provider with a first letter with upper case. I guess it's not going to happen soon but better be safe than sorry. |
I actually read
|
Did you try something like:
? ( |
worked. May I suggest that I write a PR that extends the README with a But why wasn't |
great !
I'm not sure what you need ? You can send a PR and I'll review but no promise about the merge. It would be nice to avoid adding a specific example for each provider.
I don't know. I can only guess that people used 'virtualbox' as they were already using vagrant with vbox or that vagrant is defaulting to virtualbox provider if the one specified is not available. And for the original error of this bug, it's due to my change removing the vagrant.yml file. I've used the provider name as variable in the Vagrantfile and the ruby language consider that every symbol starting with a uppercase, it's a constant but here, I want a variable. The "formal argument cannot be a constant" means that I've tried to use a constant as variable and it was not detected since all providers are in lower case. |
Regarding the README it was just about a small explanation about the providers without any short versions of the names etc. And as you said |
…ider.name as variable When using {{ instance.provider }} as variable in the generated Vagrantfile, it has to respect ruby syntax, so the first letter has to be a lower case. Until recently, either the user was using the provider name as the one specified in the Vagrant documentation or it was specifying the wrong name (like VirtualBox or VBox) and things were "just" working, since Vagrant will default to virtualbox in case it didn't find the configured provider. In the vagrant.yml removal patch, I've used the provider name as variable and with the provider set to 'VirtualBox', this will now produced the following ruby error: Vagrantfile:45: formal argument cannot be a constant So, even if it may be considered as a configuration error, it's better to ensure on our side to not produce an invalid file. The change is limited to this part of the Vagrantfile, as I guess that user will respect the casing for the other configuration options. Fix: ansible-community#91 Signed-off-by: Arnaud Patard <apatard@hupstream.com>
When using the master branch, it fails with "formal argument cannot be a constant" when creating a scenario.
Related: #87 and #90
The text was updated successfully, but these errors were encountered: