Gilles Cornu b2286388f0 provisioners/ansible: add basic config validators
With this change, the `raw_arguments` and `raw_ssh_args` options are:
- STILL automatically converted as an Array when they are set a String
  (no behaviour change)
- rejected if they are not of Array data type otherwise

Additional Notes:
- the 'as_array' tiny helper has been removed since it was no longer
  used.
- there is for now no deeper validation (i.e. verifying that the Array
  elements are only *String* objects)
2016-04-20 23:54:19 +02:00

17 lines
434 B
Ruby

require "vagrant"
module VagrantPlugins
module Ansible
class Helpers
def self.expand_path_in_unix_style(path, base_dir)
# Remove the possible drive letter, which is added
# by `File.expand_path` when running on a Windows host
File.expand_path(path, base_dir).sub(/^[a-zA-Z]:/, "")
end
def self.as_list_argument(v)
v.kind_of?(Array) ? v.join(',') : v
end
end
end
end