Class: Kitchen::Provisioner::RunListExpansionFromKitchen

Inherits:
Chef::RunList::RunListExpansion
  • Object
show all
Defined in:
lib/kitchen/provisioner/run_list_expansion_from_kitchen.rb

Overview

fetches roles from kitchen roles directory

Instance Method Summary collapse

Instance Method Details

#fetch_role(name, included_by, role_dir) ⇒ Object



25
26
27
28
29
30
# File 'lib/kitchen/provisioner/run_list_expansion_from_kitchen.rb', line 25

def fetch_role(name, included_by, role_dir)
  role_file = File.join(role_dir, "#{name}.json")
  Chef::Role.json_create(JSON.parse(File.read(role_file)))
rescue Chef::Exceptions::RoleNotFound
  role_not_found(name, included_by)
end