opsicle 2.3.1 → 2.4.0

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: c103ae75216d110fb6a062790979e73905f37ec7
4
- data.tar.gz: 1d69eb62eacff5ecc5ae5cc686e7b013b8142f9b
3
+ metadata.gz: 9e709d4cd1f9b258fae81ec63bbc659c1db1db44
4
+ data.tar.gz: 16c3c0ee8f9ac500176497998f551cb885e23d61
5
5
  SHA512:
6
- metadata.gz: a3e47337f95b9c4276dd23df6e2c0ff19215d9137eb61c5ce87ce18cc97808c04a6182b95b90171ec72de372b167155affff387e22168387fd00dc8ac524117f
7
- data.tar.gz: 7f809339f8cb9f9aa3975d9d950859c0a06640478f4a7a299dfee52be5355ef16a9c92c169dcf596651b908e27bdfca272687bb58746a31442edf194fbd12e9f
6
+ metadata.gz: aeaa6a8211aba81c3d125ab90059493e45df684dd89c31ec62690f3e3a0e037593fa1876160dcfa47b544273079bf86eb3bd5a0e57b2a3a46f6ac1197f4ffe63
7
+ data.tar.gz: 1a47aae0831ec1e2a9afa3a44475629eb18b6961660d4ea1bffb73289a28fb4513556a642c41d8d855730b34ea24c7dde85221d90837c34dbe1b82b838b2740e
@@ -11,8 +11,10 @@ module Opsicle
11
11
  @config.configure_aws_environment!(environment)
12
12
  credentials = @config.aws_credentials
13
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)
14
+ aws_opts = {region: region}
15
+ aws_opts[:credentials] = credentials unless credentials.nil?
16
+ @opsworks = Aws::OpsWorks::Client.new aws_opts
17
+ @s3 = Aws::S3::Client.new aws_opts
16
18
  end
17
19
 
18
20
  def run_command(command, command_args={}, options={})
@@ -45,7 +45,7 @@ module Opsicle
45
45
  if old_hostname =~ /\d\d\z/
46
46
  new_instance_hostname = increment_hostname(old_hostname, all_sibling_hostnames)
47
47
  else
48
- new_instance_hostname = old_hostname << "_clone"
48
+ new_instance_hostname = old_hostname << "-clone"
49
49
  end
50
50
 
51
51
  puts "\nAutomatically generated hostname: #{new_instance_hostname}\n"
@@ -60,14 +60,24 @@ module Opsicle
60
60
 
61
61
  def authenticate_with_credentials
62
62
  profile_name = opsworks_config[:profile_name] || @environment.to_s
63
- credentials = Aws::SharedCredentials.new(profile_name: profile_name)
63
+ begin
64
+ credentials = Aws::SharedCredentials.new(profile_name: profile_name)
65
+ rescue Aws::Errors::NoSuchProfileError
66
+ if ENV['AWS_SESSION_TOKEN']
67
+ Output.say('AWS profile not found; falling back to environment credentials', :debug)
68
+ else
69
+ raise Aws::Errors::NoSuchProfileError, "AWS profile #{profile_name} not found"
70
+ end
71
+ end
64
72
  region = opsworks_region
65
73
 
66
- unless credentials.set?
74
+ if !credentials.nil? && !credentials.set?
67
75
  abort('Opsicle can no longer authenticate through your ~/.fog file. Please run `opsicle legacy-credential-converter` before proceeding.')
68
76
  end
69
77
 
70
- Aws.config.update({region: region, credentials: credentials})
78
+ aws_opts = {region: region}
79
+ aws_opts[:credentials] = credentials unless credentials.nil?
80
+ Aws.config.update aws_opts
71
81
 
72
82
  iam = Aws::IAM::Client.new
73
83
 
@@ -1,3 +1,3 @@
1
1
  module Opsicle
2
- VERSION = "2.3.1"
2
+ VERSION = "2.4.0"
3
3
  end
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.3.1
4
+ version: 2.4.0
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: 2017-03-08 00:00:00.000000000 Z
12
+ date: 2017-04-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '0.5'
76
+ version: '0.6'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '0.5'
83
+ version: '0.6'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: hashdiff
86
86
  requirement: !ruby/object:Gem::Requirement