Class: Pec::Handler::Keypair
- Inherits:
-
Object
- Object
- Pec::Handler::Keypair
show all
- Extended by:
- Core
- Defined in:
- lib/pec/handler/keypair.rb
Instance Attribute Summary
Attributes included from Core
#kind
Class Method Summary
collapse
Methods included from Core
build, post_build, recover
Class Method Details
.build(config) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/pec/handler/keypair.rb', line 6
def self.build(config)
return({}) unless config.keypair
Pec::Logger.notice "keypair is #{config.keypair}"
keypair = Yao::Keypair.list.find {|k| k.name == config.keypair }
if keypair
{
key_name: keypair.name,
}
else
raise Pec::ConfigError, "keypair name=#{config.keypair} does not exist"
end
end
|