opsicle 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 022fdb3799154ce60b7e5b84cd83142ca8644024
4
- data.tar.gz: a12d87d36f1ad4e317cd96fd5cc03e990652ee27
3
+ metadata.gz: 1401401bfd3261a21d4625e88dac8de425d355d8
4
+ data.tar.gz: 720b59ad378d4cf9c51d5d85183651e6f9270f4b
5
5
  SHA512:
6
- metadata.gz: eaeab2fa154ddd9099e45a229f4e83f9f1335f3c2ee77fa30a9d53f9f50b8a2e83f05354acba47c95d225e55b86c36fbe6484d1d69187af4ddedf7fef8cee805
7
- data.tar.gz: da9e1b62d77b28b76733000234a8193ed788ed2e7060e5d17796c9c81223c32dc00b37af5c262daacc49b36006da54ed27337fedc51cbe8f1d5dbdac9091cceb
6
+ metadata.gz: c39c4868df2325522a184646ca39d12e88370cf438187be508e149ce684e9c7439582b05e3c80f5556038070d2fae28ce0f68f9151ca42bdd5638f71633c42c8
7
+ data.tar.gz: 7013c01a65830d296d6fe8cf506b7f2af39e3e6eab40100e0c222c6e987cce15ac2b5b10dc96deda62d0f724a6630684848d04c36f675ef8eb66c8e2770fcdf6
data/bin/opsicle CHANGED
@@ -21,11 +21,13 @@ DOCUMENTATION
21
21
  switch :verbose, :desc => 'Enable Verbose mode for more logging', :negatable => false
22
22
  switch :debug, :desc => 'Enable Debug mode for detailed logs and backtraces', :negatable => false
23
23
  switch :color, :desc => 'Use colored output', :default_value => true
24
+ switch :mfa, :desc => 'Use MFA for this command (some AWS operations will fail without it based on policy)', :negatable => false
24
25
 
25
26
  pre do |global_options, command, options, args|
26
27
  $verbose = global_options[:verbose]
27
28
  $debug = global_options[:debug]
28
29
  $color = global_options[:color]
30
+ $use_mfa = global_options[:mfa]
29
31
  ENV['GLI_DEBUG'] = $debug.to_s
30
32
  true
31
33
  end
@@ -67,16 +67,18 @@ module Opsicle
67
67
 
68
68
  # this will be an array of 0 or 1 because iam.list_mfa_devices.mfa_devices will only return 0 or 1 device per user;
69
69
  # if user doesn't have MFA enabled, then this loop won't even execute
70
- iam.list_mfa_devices.mfa_devices.each do |mfadevice|
71
- mfa_serial_number = mfadevice.serial_number
72
- get_mfa_token
73
- session_credentials_hash = get_session(mfa_serial_number,
74
- credentials.credentials.access_key_id,
75
- credentials.credentials.secret_access_key).credentials
76
-
77
- credentials = Aws::Credentials.new(session_credentials_hash.access_key_id,
78
- session_credentials_hash.secret_access_key,
79
- session_credentials_hash.session_token)
70
+ if $use_mfa
71
+ iam.list_mfa_devices.mfa_devices.each do |mfadevice|
72
+ mfa_serial_number = mfadevice.serial_number
73
+ get_mfa_token
74
+ session_credentials_hash = get_session(mfa_serial_number,
75
+ credentials.credentials.access_key_id,
76
+ credentials.credentials.secret_access_key).credentials
77
+
78
+ credentials = Aws::Credentials.new(session_credentials_hash.access_key_id,
79
+ session_credentials_hash.secret_access_key,
80
+ session_credentials_hash.session_token)
81
+ end
80
82
  end
81
83
 
82
84
  return credentials
@@ -1,3 +1,3 @@
1
1
  module Opsicle
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
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.0.0
4
+ version: 2.0.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-07-27 00:00:00.000000000 Z
12
+ date: 2016-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk
@@ -274,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
274
  version: '0'
275
275
  requirements: []
276
276
  rubyforge_project:
277
- rubygems_version: 2.4.6
277
+ rubygems_version: 2.4.8
278
278
  signing_key:
279
279
  specification_version: 4
280
280
  summary: An opsworks specific abstraction on top of the aws sdk
@@ -303,3 +303,4 @@ test_files:
303
303
  - spec/opsicle/s3_bucket_spec.rb
304
304
  - spec/opsicle/user_profile_spec.rb
305
305
  - spec/spec_helper.rb
306
+ has_rdoc: