Class: Chef::RunList::RunListExpansionFromAPI

Inherits:
RunListExpansion show all
Defined in:
lib/chef/run_list/run_list_expansion.rb

Overview

Expand a run list from the chef-server API.

Instance Attribute Summary

Attributes inherited from RunListExpansion

#default_attrs, #errors, #override_attrs, #recipes, #run_list_items, #source

Instance Method Summary collapse

Methods inherited from RunListExpansion

#applied_role, #applied_role?, #apply_role_attributes, #errors?, #expand, #inflate_role, #initialize, #role_not_found, #roles

Constructor Details

This class inherits a constructor from Chef::RunList::RunListExpansion

Instance Method Details

#fetch_role(name) ⇒ Object



146
147
148
149
150
151
152
153
154
# File 'lib/chef/run_list/run_list_expansion.rb', line 146

def fetch_role(name)
  rest.get_rest("roles/#{name}")
rescue Net::HTTPServerException => e
  if e.message == '404 "Not Found"'
    role_not_found(name)
  else
    raise
  end
end

#restObject



142
143
144
# File 'lib/chef/run_list/run_list_expansion.rb', line 142

def rest
  @rest ||= (source || Chef::REST.new(Chef::Config[:role_url]))
end