Class: Umami::Client
- Inherits:
-
Object
- Object
- Umami::Client
- Defined in:
- lib/chef-umami/client.rb
Instance Method Summary collapse
- #client ⇒ Object
-
#compile ⇒ Object
Execute the compile phase of a Chef client run.
-
#initialize ⇒ Client
constructor
A new instance of Client.
-
#prep ⇒ Object
Perform the steps required prior to compiling resources, including running Ohai and building up the node object.
-
#resource_collection ⇒ Object
TODO: This can only be called after #prep completes successfully.
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
19 20 21 |
# File 'lib/chef-umami/client.rb', line 19 def initialize @client = client end |
Instance Method Details
#client ⇒ Object
23 24 25 |
# File 'lib/chef-umami/client.rb', line 23 def client @client ||= Chef::Client.new end |
#compile ⇒ Object
Execute the compile phase of a Chef client run.
36 37 38 39 |
# File 'lib/chef-umami/client.rb', line 36 def compile prep client.setup_run_context end |
#prep ⇒ Object
Perform the steps required prior to compiling resources, including running Ohai and building up the node object.
29 30 31 32 33 |
# File 'lib/chef-umami/client.rb', line 29 def prep client.run_ohai client.load_node # from the server client.build_node end |
#resource_collection ⇒ Object
TODO: This can only be called after #prep completes successfully. Add some check to determine if the client is actually prepped.
43 44 45 |
# File 'lib/chef-umami/client.rb', line 43 def resource_collection client.run_status.run_context.resource_collection end |