chef-metal-fog 0.6 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef_metal_fog/fog_driver.rb +12 -4
- data/lib/chef_metal_fog/providers/aws.rb +1 -1
- data/lib/chef_metal_fog/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: b5883afe070478a843245ccc9844ea0f355e9596
|
4
|
+
data.tar.gz: f3ea03361d9501d0860e32eadfbad2a0408164dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 580d1fc60224a67c4962f76c208ffa1691fb0b82b882e01769d624a066237fb2f4a413afb0591ca9562883373fe22dde212ebfd861374b772d63f031e7b12d3d
|
7
|
+
data.tar.gz: 83f6827b9ead2253391d5a409c32a869e40e2d4d31ab36cba8880f338e6ccac5149a14cd8732bd3129f08de1006d15ee4850b76d9a027f0ac9244a7e059b797c
|
@@ -497,17 +497,25 @@ module ChefMetalFog
|
|
497
497
|
}.merge(machine_options[:ssh_options] || {})
|
498
498
|
if server.respond_to?(:private_key) && server.private_key
|
499
499
|
result[:key_data] = [ server.private_key ]
|
500
|
-
elsif server.respond_to?(:key_name)
|
501
|
-
|
500
|
+
elsif server.respond_to?(:key_name) && server.key_name
|
501
|
+
key = get_private_key(server.key_name)
|
502
|
+
if !key
|
503
|
+
raise "Server has key name '#{server.key_name}', but the corresponding private key was not found locally. Check if the key is in Chef::Config.private_key_paths: #{Chef::Config.private_key_paths.join(', ')}"
|
504
|
+
end
|
505
|
+
result[:key_data] = [ key ]
|
502
506
|
elsif machine_spec.location['key_name']
|
503
|
-
|
507
|
+
key = get_private_key(machine_spec.location['key_name'])
|
508
|
+
if !key
|
509
|
+
raise "Server was created with key name '#{machine_spec.location['key_name']}', but the corresponding private key was not found locally. Check if the key is in Chef::Config.private_key_paths: #{Chef::Config.private_key_paths.join(', ')}"
|
510
|
+
end
|
511
|
+
result[:key_data] = [ key ]
|
504
512
|
elsif machine_options[:bootstrap_options][:key_path]
|
505
513
|
result[:key_data] = [ IO.read(machine_options[:bootstrap_options][:key_path]) ]
|
506
514
|
elsif machine_options[:bootstrap_options][:key_name]
|
507
515
|
result[:key_data] = [ get_private_key(machine_options[:bootstrap_options][:key_name]) ]
|
508
516
|
else
|
509
517
|
# TODO make a way to suggest other keys to try ...
|
510
|
-
raise "No key found to connect to #{machine_spec.name}!"
|
518
|
+
raise "No key found to connect to #{machine_spec.name} (#{machine_spec.location.inspect})!"
|
511
519
|
end
|
512
520
|
result
|
513
521
|
end
|
@@ -23,7 +23,7 @@ module ChefMetalFog
|
|
23
23
|
def bootstrap_options_for(action_handler, machine_spec, machine_options)
|
24
24
|
bootstrap_options = symbolize_keys(machine_options[:bootstrap_options] || {})
|
25
25
|
|
26
|
-
|
26
|
+
if !bootstrap_options[:key_name]
|
27
27
|
bootstrap_options[:key_name] = overwrite_default_key_willy_nilly(action_handler)
|
28
28
|
end
|
29
29
|
|