Class: Pec::Handler::Keypair
- Inherits:
-
Object
- Object
- Pec::Handler::Keypair
- Extended by:
- Core
- Defined in:
- lib/pec/handler/keypair.rb
Class Method Summary collapse
Class Method Details
.build(host) ⇒ 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(host) return({}) unless host.keypair Pec::Logger.notice "keypair is #{host.keypair}" keypair = Yao::Keypair.list.find {|k| k.name == host.keypair } if keypair { key_name: keypair.name, } else raise Pec::ConfigError, "keypair name=#{host.keypair} does not exist" end end |