diff --git a/lib/vagrant-google/config.rb b/lib/vagrant-google/config.rb index c18e1aa..fe612de 100644 --- a/lib/vagrant-google/config.rb +++ b/lib/vagrant-google/config.rb @@ -210,6 +210,11 @@ def zone_config(zone, attributes=nil, &block) @__zone_config[zone] << block if block_given? end + def expand_path(path, root_path) + return path if not path + return Pathname.new(path).expand_path(root_path) + end + #------------------------------------------------------------------- # Internal methods. #------------------------------------------------------------------- @@ -338,6 +343,9 @@ def validate(machine) if @zone config = get_zone_config(@zone) + config.google_key_location = expand_path(config.google_key_location, machine.env.root_path) + config.google_json_key_location = expand_path(config.google_json_key_location, machine.env.root_path) + errors << I18n.t("vagrant_google.config.google_project_id_required") if \ config.google_project_id.nil? errors << I18n.t("vagrant_google.config.google_client_email_required") if \