Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/vagrant-google/config.rb
Original file line number Diff line number Diff line change
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