provisioners/ansible_local: fix a str-to-sym bug

Without this change `ansible.version = "latest"` is not considered as
equivalent to `ansible.version = :latest`.
This commit is contained in:
Gilles Cornu 2015-11-12 09:09:58 +01:00
parent c6ef73a6fa
commit 75cc6ef8d3
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ module VagrantPlugins
# Try to install Ansible (if needed and requested)
if config.install &&
(config.version == :latest ||
(config.version.to_s.to_sym == :latest ||
!@machine.guest.capability(:ansible_installed, config.version))
@machine.ui.detail(I18n.t("vagrant.provisioners.ansible.installing"))
@machine.guest.capability(:ansible_install)
@ -59,7 +59,7 @@ module VagrantPlugins
# Check if requested ansible version is available
if (!config.version.empty? &&
config.version != :latest &&
config.version.to_s.to_sym != :latest &&
!@machine.guest.capability(:ansible_installed, config.version))
raise Ansible::Errors::AnsibleVersionNotFoundOnGuest, required_version: config.version.to_s
end