From 34eb88e85ca616ade108d7fb84b568c9c32a0422 Mon Sep 17 00:00:00 2001 From: Brian Dwyer Date: Sat, 2 Jun 2018 08:28:33 -0400 Subject: [PATCH 1/2] Cut over to fog-aws Signed-off-by: Brian Dwyer --- Gemfile | 2 +- lib/vagrant-aws/action/connect_aws.rb | 2 +- lib/vagrant-aws/version.rb | 2 +- vagrant-aws.gemspec | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 4d52f3a6..ac734597 100644 --- a/Gemfile +++ b/Gemfile @@ -10,5 +10,5 @@ group :development do end group :plugins do - gem "vagrant-aws" , path: "." + gemspec end diff --git a/lib/vagrant-aws/action/connect_aws.rb b/lib/vagrant-aws/action/connect_aws.rb index 76beda6f..bec6ae6b 100644 --- a/lib/vagrant-aws/action/connect_aws.rb +++ b/lib/vagrant-aws/action/connect_aws.rb @@ -1,4 +1,4 @@ -require "fog" +require "fog-aws" require "log4r" module VagrantPlugins diff --git a/lib/vagrant-aws/version.rb b/lib/vagrant-aws/version.rb index 3853ee54..247b96fd 100644 --- a/lib/vagrant-aws/version.rb +++ b/lib/vagrant-aws/version.rb @@ -1,5 +1,5 @@ module VagrantPlugins module AWS - VERSION = '0.7.2' + VERSION = '0.8.0' end end diff --git a/vagrant-aws.gemspec b/vagrant-aws.gemspec index be8aae7a..4142f490 100644 --- a/vagrant-aws.gemspec +++ b/vagrant-aws.gemspec @@ -1,4 +1,6 @@ -$:.unshift File.expand_path("../lib", __FILE__) +# coding: utf-8 +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "vagrant-aws/version" Gem::Specification.new do |s| @@ -15,7 +17,7 @@ Gem::Specification.new do |s| s.required_rubygems_version = ">= 1.3.6" s.rubyforge_project = "vagrant-aws" - s.add_runtime_dependency "fog", "~> 1.22" + s.add_runtime_dependency "fog-aws", "~> 3.0" s.add_runtime_dependency "iniparse", "~> 1.4", ">= 1.4.2" s.add_development_dependency "rake" From 945a40b015796ec58668456dde72939dd0272072 Mon Sep 17 00:00:00 2001 From: Brian Dwyer Date: Sat, 2 Jun 2018 13:29:03 -0400 Subject: [PATCH 2/2] Fix profile issue Signed-off-by: Brian Dwyer --- lib/vagrant-aws/config.rb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/vagrant-aws/config.rb b/lib/vagrant-aws/config.rb index 30a19cb4..4b59cc2c 100644 --- a/lib/vagrant-aws/config.rb +++ b/lib/vagrant-aws/config.rb @@ -525,25 +525,17 @@ def get_aws_info(profile, location) private def read_aws_files(profile, aws_config, aws_creds) - # determine section in config ini file - if profile == 'default' - ini_profile = profile - else - ini_profile = 'profile ' + profile - end # get info from config ini file for selected profile data = File.read(aws_config) doc_cfg = IniParse.parse(data) - aws_region = doc_cfg[ini_profile]['region'] + aws_region = doc_cfg[profile]['region'] - # determine section in credentials ini file - ini_profile = profile # get info from credentials ini file for selected profile data = File.read(aws_creds) doc_cfg = IniParse.parse(data) - aws_id = doc_cfg[ini_profile]['aws_access_key_id'] - aws_secret = doc_cfg[ini_profile]['aws_secret_access_key'] - aws_token = doc_cfg[ini_profile]['aws_session_token'] + aws_id = doc_cfg[profile]['aws_access_key_id'] + aws_secret = doc_cfg[profile]['aws_secret_access_key'] + aws_token = doc_cfg[profile]['aws_session_token'] return aws_region, aws_id, aws_secret, aws_token end