Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 2865ab2

Browse files
authored
molecule_vagrant/modules/vagrant.py: Fix libvirt option driver test (#89)
In commit "Set cpu to qemu64 with qemu driver", defined?() has been used to check if provider['options']['driver'] is defined but it seems that the test is not doing what I was expecting. Switching to .has_key? is fixing the issue. Signed-off-by: Arnaud Patard <[email protected]>
1 parent 07f205b commit 2865ab2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

molecule_vagrant/modules/vagrant.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@
327327
# Not sure were the bug is (libvirt or qemu or alpine or all of them) but using QEMU64
328328
# cpu model will work around this. Hopefully, by checking 'cpu_mode' option, it will
329329
# allow people to override the model to use.
330-
if defined?(provider['options']['driver']) && provider['options']['driver'].include?('qemu')
331-
if !provider['options']['cpu_mode']
330+
if provider['options'].has_key?('driver') && provider['options']['driver'].include?('qemu')
331+
if !provider['options'].has_key?('cpu_mode')
332332
libvirt.cpu_mode = 'custom'
333333
libvirt.cpu_model = 'qemu64'
334334
end

0 commit comments

Comments
 (0)