module ChefUtils::Internal

def __config

Other tags:
    Api: - private

Returns:
  • (Hash) - hash-like config object
def __config
  raise NotImplementedError
end

def __env_path

Other tags:
    Api: - private
def __env_path
  if __transport_connection
    __transport_connection.run_command("echo $PATH").stdout.chomp || ""
  else
    ENV["PATH"] || ""
  end
end

def __getnode(skip_global = false)

Other tags:
    Api: - private

Returns:
  • (Hash) - hash-like config object
def __getnode(skip_global = false)
  # Software developers should feel free to rely on the default wiring here to the node method by implementing the node method in their
  # own class.  For anything more complicated they should completely override the method (overriding the whole method is never wrong and
  # is safer).
  return node if respond_to?(:node) && node
  return run_context&.node if respond_to?(:run_context) && run_context&.node
  unless skip_global
    return Chef.run_context&.node if defined?(Chef) && Chef.respond_to?(:run_context) && Chef.run_context&.node
  end
  nil
end

def __log

Other tags:
    Api: - private

Returns:
  • (Chef::Log) - logger-like logging object
def __log
  raise NotImplementedError
end

def __transport_connection

Other tags:
    Api: - private

Returns:
  • (Train::Plugins::Transport) -
def __transport_connection
  # Software consumers MUST override this method with their own implementation.  The default behavior here is subject to change.
  return Chef.run_context.transport_connection if defined?(Chef) && Chef.respond_to?(:run_context) && Chef&.run_context&.transport_connection
  nil
end