contrib/vagrant: fix env vars type conversion

Explicitly set type for integer environment variables:

* VAGRANT_KURYR_VM_MEMORY
* VAGRANT_KURYR_VM_CPUS

Despite there is a fix in the Vagrant git repo for that
issue, still exist systems where the issue is not fixed.
On those systems trying to limit the VM memory one will
get «no implicit conversion of String into Integer».

Thus convert the environment variables to int explicitly.

Change-Id: I80a39e0b072159b601dd8cadf839e596ea64e644
Bug-Url: https://github.com/vagrant-libvirt/vagrant-libvirt/issues/525
Bug-Url: https://github.com/vagrant-libvirt/vagrant-libvirt/pull/526
This commit is contained in:
Peter V. Saveliev 2016-06-23 13:50:02 +02:00
parent c5f5ff2aea
commit 27711777d6

View File

@ -2,8 +2,8 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
VM_MEMORY = ENV.fetch('VAGRANT_KURYR_VM_MEMORY', 6144)
VM_CPUS = ENV.fetch('VAGRANT_KURYR_VM_CPUS', 2)
VM_MEMORY = ENV.fetch('VAGRANT_KURYR_VM_MEMORY', 6144).to_i
VM_CPUS = ENV.fetch('VAGRANT_KURYR_VM_CPUS', 2).to_i
RUN_DEVSTACK = ENV.fetch('VAGRANT_KURYR_RUN_DEVSTACK', 'true')
config.vm.hostname = 'devstack'