miasma-aws 0.1.10 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/miasma-aws/version.rb +1 -1
- data/lib/miasma/contrib/aws.rb +37 -21
- data/lib/miasma/contrib/aws/storage.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2967860cfc9a00bdddaeec82c625e67b0deebbc2
|
4
|
+
data.tar.gz: 5aed93a44a616148a18a432b2e5f6a94b41c2958
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83cc2ff04ee739492a8c721d532c1c801f4e2a409c1472c5221c8e5cb67524406b067fa832d1307113e6621ae38eb83e08808cbaca507c0e798463a644f81e1e
|
7
|
+
data.tar.gz: 8ed083d3348fd7dfc087c7195275b5c272bb8500e05c1a45eda9fef0978862cd3aee6ad55105916a4f43dd9aab3318e96f1cd99149713e0152bd5eb71e3fb984
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## v0.1.12
|
2
|
+
* Update default file paths to use `Dir.home` instead of ~ expansion
|
3
|
+
* Fix bug reading .aws/credentials when whitespace is used
|
4
|
+
* Add support for .aws/config
|
5
|
+
* Auto detect us-east-1 region and do not use custom s3 endpoint
|
6
|
+
|
1
7
|
## v0.1.10
|
2
8
|
* Fix disable rollback mapping value to on failure
|
3
9
|
|
data/lib/miasma-aws/version.rb
CHANGED
data/lib/miasma/contrib/aws.rb
CHANGED
@@ -327,8 +327,9 @@ module Miasma
|
|
327
327
|
|
328
328
|
def self.included(klass)
|
329
329
|
klass.class_eval do
|
330
|
-
attribute :aws_profile_name, String
|
331
|
-
attribute :aws_credentials_file, String, :required => true, :default => File.
|
330
|
+
attribute :aws_profile_name, String, :default => 'default'
|
331
|
+
attribute :aws_credentials_file, String, :required => true, :default => File.join(Dir.home, '.aws/credentials')
|
332
|
+
attribute :aws_config_file, String, :required => true, :default => File.join(Dir.home, '.aws/config')
|
332
333
|
attribute :aws_access_key_id, String, :required => true
|
333
334
|
attribute :aws_secret_access_key, String, :required => true
|
334
335
|
attribute :aws_region, String, :required => true
|
@@ -364,34 +365,49 @@ module Miasma
|
|
364
365
|
# @return [TrueClass]
|
365
366
|
def custom_setup(creds)
|
366
367
|
if(creds[:aws_profile_name])
|
367
|
-
creds.replace(
|
368
|
+
creds.replace(
|
369
|
+
load_aws_file(
|
370
|
+
aws_config_file,
|
371
|
+
creds[:aws_profile_name]
|
372
|
+
).merge(
|
373
|
+
load_aws_file(
|
374
|
+
aws_credentials_file,
|
375
|
+
creds[:aws_profile_name]
|
376
|
+
)
|
377
|
+
).merge(creds)
|
378
|
+
)
|
368
379
|
end
|
369
380
|
end
|
370
381
|
|
371
|
-
# Load
|
382
|
+
# Load configuration from the AWS configuration file
|
372
383
|
#
|
384
|
+
# @param file_path [String] path to configuration file
|
373
385
|
# @param profile [String] name of profile to load
|
374
386
|
# @return [Smash]
|
375
|
-
def
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
line
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
387
|
+
def load_aws_file(file_path, profile)
|
388
|
+
if(File.exists?(file_path))
|
389
|
+
l_config = Smash.new.tap do |creds|
|
390
|
+
key = nil
|
391
|
+
File.readlines(file_path).each do |line|
|
392
|
+
line.strip!
|
393
|
+
if(line.start_with?('[') && line.end_with?(']'))
|
394
|
+
key = line.tr('[]', '').strip
|
395
|
+
creds[key] = Smash.new
|
396
|
+
else
|
397
|
+
creds[key].merge!(Smash[*line.split('=').map(&:strip)])
|
398
|
+
end
|
385
399
|
end
|
386
400
|
end
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
401
|
+
l_config.fetch(
|
402
|
+
:default, Smash.new
|
403
|
+
).merge(
|
404
|
+
l_config.fetch(
|
405
|
+
profile, Smash.new
|
406
|
+
)
|
393
407
|
)
|
394
|
-
|
408
|
+
else
|
409
|
+
Smash.new
|
410
|
+
end
|
395
411
|
end
|
396
412
|
|
397
413
|
# Setup for API connections
|
@@ -23,7 +23,7 @@ module Miasma
|
|
23
23
|
args[:aws_region] = args.fetch(:aws_bucket_region, 'us-east-1')
|
24
24
|
super(args)
|
25
25
|
aws_region = cache_region
|
26
|
-
if(aws_bucket_region)
|
26
|
+
if(aws_bucket_region && aws_bucket_region != 'us-east-1')
|
27
27
|
self.aws_host = "s3-#{aws_bucket_region}.amazonaws.com"
|
28
28
|
else
|
29
29
|
self.aws_host = 's3.amazonaws.com'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miasma-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: miasma
|
@@ -137,4 +137,3 @@ signing_key:
|
|
137
137
|
specification_version: 4
|
138
138
|
summary: Smoggy AWS API
|
139
139
|
test_files: []
|
140
|
-
has_rdoc:
|