class Chef::Provider::OneUser

Implementation of Provider class.

Attributes

current_user[R]

Public Instance Methods

action_handler() click to toggle source
# File lib/chef/provider/one_user.rb, line 33
def action_handler
  @action_handler ||= Chef::Provisioning::ChefProviderActionHandler.new(self)
end
exists?(filter) click to toggle source
# 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

Protected Instance Methods

current_driver() click to toggle source
# File lib/chef/provider/one_user.rb, line 97
def current_driver
  run_context.chef_provisioning.driver_for(run_context.chef_provisioning.current_driver) if run_context.chef_provisioning.current_driver
end
driver() click to toggle source
# File lib/chef/provider/one_user.rb, line 85
def driver
  if current_driver && current_driver.driver_url != new_driver.driver_url
    fail "Cannot move '#{machine_spec.name}' from #{current_driver.driver_url} to #{new_driver.driver_url}: machine moving is not supported.  Destroy and recreate."
  end
  fail "Driver not specified for one_user #{new_resource.name}" unless new_driver
  new_driver
end
new_driver() click to toggle source
# File lib/chef/provider/one_user.rb, line 93
def new_driver
  run_context.chef_provisioning.driver_for(new_resource.driver)
end