Class | Chef::RunList::RunListExpansion
In: | lib/chef/run_list/run_list_expansion.rb
Parent: | Object

Abstract Base class for expanding a run list. Subclasses must handle fetching roles from a data source by defining `fetch_role`

### Methods

applied_role? apply_role_attributes errors? expand fetch_role inflate_role invalid? new role_not_found roles

### Attributes

default_attrs | [R] |
environment | [R] |
errors | [R] |
override_attrs | [R] |
recipes | [R] | A VersionedRecipeList of recipes. Populated only after expand is called.
run_list_items | [R] |
source | [R] | The data source passed to the constructor. Not used in this class. In subclasses, this is a couchdb or Chef::REST object pre-configured to fetch roles from their correct location.

### Public Class methods

new(environment, run_list_items, source=nil)

### Public Instance methods

applied_role?(role_name)
apply_role_attributes(role)
errors?()

Did we find any errors (expanding roles)?

expand()

Recurses over the run list items, expanding roles. After this, `recipes` will contain the fully expanded recipe list

fetch_role(name)

In subclasses, this method will fetch the role from the data source.

inflate_role(role_name)

Fetches and inflates a role

### Returns

Chef::Role in most cases false if the role has already been applied nil if the role does not exist

invalid?()

Alias for errors?

role_not_found(name)

When a role is not found, an error message is logged, but no exception is raised. We do add an entry in the errors collection.

### Returns

nil

roles()

Returns an array of role names that were expanded; this includes any roles that were in the original, pre-expansion run_list as well as roles processed during expansion. Populated only after expand is called.

[Validate]