Skip to content

Commit

Permalink
Merge pull request #167 from luto/fix-159-relative-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
erjohnso committed May 11, 2017
2 parents d84647c + d821468 commit 3627c4f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/vagrant-google/config.rb
Expand Up @@ -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.
#-------------------------------------------------------------------
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit 3627c4f

Please sign in to comment.