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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec7bcd76444b28a226d7c0c5febce96c925bcd23
4
- data.tar.gz: 55449680571636b23918800906c4e4febfffa140
3
+ metadata.gz: 3c60e057c1ae5e457b2fa45fa24df6cd731c991d
4
+ data.tar.gz: 98e0d57617f789ba4257bc4ae56c0dce45c15382
5
5
  SHA512:
6
- metadata.gz: 2cf7eaf4e4f03ba30f6e94343f686e70ffa0977c9fe7ee2ca720844da4d669cfde5a9c1641dc9e9e09b3f738b9ad9f76117095f37ccfac75738828af1fb7dd9f
7
- data.tar.gz: 6b56a7854bc35f9e45994bd4887bcb583356692110dbbb1fd0c43a19b21253155db10c8fb43fcbc57878d7348fb8de4c17a38e341bbc129f807323683167346e
6
+ metadata.gz: 7e43db6dd93aad57e923922b3fb5f83ee9351da21a1d3e888aa91a4b26855b02fea02207805663b2ebc1e7d6fc636bfb0bb69feec4e5bd60d878b5a4aed827b6
7
+ data.tar.gz: 6c95ee0e53ae3674a12d87af9472c8b89bcbabe5c0e2e695c95cdff9f4fd27f5273d1451a737253c7fd7a0718504886bac48de17f5da8c0a9fc4e1dd15bedcef
@@ -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"
@@ -1,3 +1,3 @@
1
1
  module FogToTerraform
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog_to_terraform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dr Nic Williams