opsicle 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef5c24375ecdfc5f145c4629f7cd616e6606e311
4
- data.tar.gz: a66ff71b1fd05c809d41af6ce5b728ba814c1884
3
+ metadata.gz: f4cc47663adbf7d7079db60f9dd4fd55c58c5f7d
4
+ data.tar.gz: cf583de4cb67fe7f9b291185c9bc070ca7af325e
5
5
  SHA512:
6
- metadata.gz: 911b78c35cb0e6ad3f620f2a2ef9c2b9068246e6c10897f8fb35449f971927c3cef524bc346628eb27989b218c769a7e4443e85bc207d4183ca92ab8919b0874
7
- data.tar.gz: 68b131b034da7f96aefd511ae4d2d343affe92b3c4d50fa19d66e4fe503239d0f2a3f9499b6a47c52ff00e60cffd065b3563a4f4daca065ae79a9fcaf4ea532b
6
+ metadata.gz: faa539c5e2238a4107c4d80774c083bbe02be70e4e3c459c9d0114d60ff1c4add9f61711429055e54d59272447853e4c3dfddf6cbeb665218b96518029029251
7
+ data.tar.gz: 5fcb498e1cf36b97413e95ed306e65812c77406d34709f6203347b9042a6d461965456a947f461b0249cd4589f0822ce952a52544af401ec7cf99ba5b3c6df91
@@ -10,8 +10,9 @@ module Opsicle
10
10
  @config = Config.instance
11
11
  @config.configure_aws_environment!(environment)
12
12
  credentials = @config.aws_credentials
13
- @opsworks = Aws::OpsWorks::Client.new(region: 'us-east-1', credentials: credentials)
14
- @s3 = Aws::S3::Client.new(region: 'us-east-1', credentials: credentials)
13
+ region = @config.opsworks_region
14
+ @opsworks = Aws::OpsWorks::Client.new(region: region, credentials: credentials)
15
+ @s3 = Aws::S3::Client.new(region: region, credentials: credentials)
15
16
  end
16
17
 
17
18
  def run_command(command, command_args={}, options={})
@@ -20,6 +20,10 @@ module Opsicle
20
20
  @opsworks_config ||= load_config(OPSICLE_CONFIG_PATH)
21
21
  end
22
22
 
23
+ def opsworks_region
24
+ opsworks_config[:region] || "us-east-1"
25
+ end
26
+
23
27
  def configure_aws_environment!(environment)
24
28
  @environment = environment.to_sym
25
29
  end
@@ -57,12 +61,13 @@ module Opsicle
57
61
  def authenticate_with_credentials
58
62
  profile_name = opsworks_config[:profile_name] || @environment.to_s
59
63
  credentials = Aws::SharedCredentials.new(profile_name: profile_name)
64
+ region = opsworks_region
60
65
 
61
66
  unless credentials.set?
62
67
  abort('Opsicle can no longer authenticate through your ~/.fog file. Please run `opsicle legacy-credential-converter` before proceeding.')
63
68
  end
64
69
 
65
- Aws.config.update({region: 'us-east-1', credentials: credentials})
70
+ Aws.config.update({region: region, credentials: credentials})
66
71
 
67
72
  iam = Aws::IAM::Client.new
68
73
 
@@ -1,3 +1,3 @@
1
1
  module Opsicle
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
@@ -10,6 +10,7 @@ module Opsicle
10
10
  mock_keys = {access_key_id: 'key', secret_access_key: 'secret'}
11
11
  allow(config).to receive(:aws_credentials).and_return(mock_keys)
12
12
  allow(config).to receive(:opsworks_config).and_return({ stack_id: 'stack', app_id: 'app', something_else: 'true' })
13
+ allow(config).to receive(:opsworks_region).and_return('us-east-1')
13
14
  allow(Config).to receive(:new).and_return(config)
14
15
  allow(Config).to receive(:instance).and_return(config)
15
16
  allow(Aws::OpsWorks::Client).to receive(:new).and_return(aws_client)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsicle
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Fleener
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-10-17 00:00:00.000000000 Z
12
+ date: 2016-12-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk