fog_to_terraform 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fog_to_terraform/app.rb +10 -1
- data/lib/fog_to_terraform/version.rb +1 -1
- 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: 3c60e057c1ae5e457b2fa45fa24df6cd731c991d
|
4
|
+
data.tar.gz: 98e0d57617f789ba4257bc4ae56c0dce45c15382
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e43db6dd93aad57e923922b3fb5f83ee9351da21a1d3e888aa91a4b26855b02fea02207805663b2ebc1e7d6fc636bfb0bb69feec4e5bd60d878b5a4aed827b6
|
7
|
+
data.tar.gz: 6c95ee0e53ae3674a12d87af9472c8b89bcbabe5c0e2e695c95cdff9f4fd27f5273d1451a737253c7fd7a0718504886bac48de17f5da8c0a9fc4e1dd15bedcef
|
data/lib/fog_to_terraform/app.rb
CHANGED
@@ -27,9 +27,18 @@ class FogToTerraform::App
|
|
27
27
|
lambda { |value| credentials_file = value }
|
28
28
|
end
|
29
29
|
remaining_args = opts.parse(args)
|
30
|
-
credentials_key = remaining_args.shift || "default"
|
31
30
|
|
32
31
|
all_credentials = YAML.load_file(File.expand_path(credentials_file))
|
32
|
+
unless credentials_key = remaining_args.shift
|
33
|
+
if all_credentials.keys.size == 1
|
34
|
+
credentials_key = all_credentials.keys.first
|
35
|
+
else
|
36
|
+
$stderr.puts "#{credentials_file} contains more than one key; pass it as an argument\n\n"
|
37
|
+
puts opts
|
38
|
+
exit 1
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
33
42
|
credentials = all_credentials[credentials_key.to_sym] || all_credentials[credentials_key.to_s]
|
34
43
|
unless credentials
|
35
44
|
$stderr.puts "Cannot find '#{credentials_key}' key in #{credentials_file}\n\n"
|