Class: Chef::Provider::OneUser

Inherits:
LWRPBase
  • Object
show all
Defined in:
lib/chef/provider/one_user.rb

Overview

Implementation of Provider class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_userObject (readonly)

Returns the value of attribute current_user.



31
32
33
# File 'lib/chef/provider/one_user.rb', line 31

def current_user
  @current_user
end

Instance Method Details

#action_handlerObject



33
34
35
# File 'lib/chef/provider/one_user.rb', line 33

def action_handler
  @action_handler ||= Chef::Provisioning::ChefProviderActionHandler.new(self)
end

#exists?(filter) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
40
41
42
# File 'lib/chef/provider/one_user.rb', line 37

def exists?(filter)
  new_driver = driver
  @current_user = new_driver.one.get_resource(:user, filter)
  Chef::Log.debug("user '#{filter}' exists: #{!@current_user.nil?}")
  !@current_user.nil?
end