Class: Pec::Handler::Flavor

Inherits:
Object
  • Object
show all
Extended by:
Core
Defined in:
lib/pec/handler/flavor.rb

Class Method Summary collapse

Class Method Details

.build(host) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/pec/handler/flavor.rb', line 6

def self.build(host)
  Pec::Logger.notice "flavor is #{host.flavor}"
  flavor_id = Yao::Flavor.list.find {|flavor| flavor.name == host.flavor}.id
  {
    flavorRef:  flavor_id
  }
rescue
  raise Pec::ConfigError, "flavor name=#{host.flavor} does not exist"
end