cloudformation-tool 0.4.2 → 0.4.3
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 +4 -4
- data/lib/cloud_formation_tool/version.rb +1 -1
- data/lib/cloud_formation_tool.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 89f6e35519b2dc452816d1de7d739239a0ff82b1
|
|
4
|
+
data.tar.gz: fe7eef6f7d6f6b0d7e94fe7bbf2a3da4536b003e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70745be5ac9ef3596e51faa8e5a87f9531ad2614bf1e232a23435077389e553b52f358ded04e9c5a8789d1f560f553560f861b638ebc91f6751abbfdd3a5d875
|
|
7
|
+
data.tar.gz: 8b5afc00c304caeb8351abb8a2bb632697c9d2be495f76c1c7b13c540cfa0d9fb8732a05d0061b99598b2ac7a47f88b7f3ec1fcc798a72df00a2b636d21e99a5
|
data/lib/cloud_formation_tool.rb
CHANGED
|
@@ -16,9 +16,9 @@ module CloudFormationTool
|
|
|
16
16
|
autoloaded.with :CLI
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def find_profile(dir = nil)
|
|
19
|
+
def find_profile(dir = nil, default = nil)
|
|
20
20
|
dir ||= Dir.pwd
|
|
21
|
-
return
|
|
21
|
+
return default if (dir == "/")
|
|
22
22
|
begin
|
|
23
23
|
return File.read("#{dir}/.awsprofile").chomp
|
|
24
24
|
rescue Errno::ENOENT
|
|
@@ -31,11 +31,11 @@ module CloudFormationTool
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def profile
|
|
34
|
-
$__profile ||= (ENV['AWS_DEFAULT_PROFILE'] || 'default')
|
|
34
|
+
$__profile ||= find_profile(nil, ENV['AWS_DEFAULT_PROFILE'] || 'default')
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def awscreds
|
|
38
|
-
$__aws_creds ||= Aws::SharedCredentials.new(profile_name:
|
|
38
|
+
$__aws_creds ||= Aws::SharedCredentials.new(profile_name: profile)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def aws_config
|