Class: Umami::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/chef-umami/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



21
22
23
# File 'lib/chef-umami/client.rb', line 21

def initialize
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



20
21
22
# File 'lib/chef-umami/client.rb', line 20

def client
  @client
end

Instance Method Details

#compileObject

Execute the compile phase of a Chef client run.



38
39
40
41
# File 'lib/chef-umami/client.rb', line 38

def compile
  prep
  client.setup_run_context
end

#prepObject

Perform the steps required prior to compiling resources, including running Ohai and building up the node object.



31
32
33
34
35
# File 'lib/chef-umami/client.rb', line 31

def prep
  client.run_ohai
  client.load_node # from the server
  client.build_node
end

#resource_collectionObject

TODO: This can only be called after #prep completes successfully. Add some check to determine if the client is actually prepped.



45
46
47
# File 'lib/chef-umami/client.rb', line 45

def resource_collection
  client.run_status.run_context.resource_collection
end