def converge(ohai)
      begin
        # When the run_list consists solely of RightScripts, adding error or report
        # handlers is not possible. Suppress these extra features as they can
        # be confusing to users. Also makes for cleaner logs.
        if @only_scripts
          ::Chef::Client.clear_notifications
        end

        if @cookbooks.size > 0
          @audit.create_new_section('Converging')
        else
          @audit.create_new_section('Preparing execution')
        end

        log_desc = "Log level is #{Log.level_to_sym(CookState.log_level)}"
        if CookState.dev_log_level
          log_desc << " (overridden by #{CookState::LOG_LEVEL_TAG}=#{CookState.dev_log_level})"
        end
        log_desc << '.'
        @audit.append_info(log_desc)
        @audit.append_info('The download once flag is set.') if CookState.download_once?

        @audit.append_info("Run list for thread #{@thread_name.inspect} contains #{@run_list.size} items.")
        @audit.append_info(@run_list.join(', '))

        attribs = { 'run_list' => @run_list }
        attribs.merge!(@attributes) if @attributes
        c      = Chef::Client.new(attribs)
        c.ohai = ohai
        audit_time do
          # Ensure that Ruby subprocesses invoked by Chef do not inherit our
          # RubyGems/Bundler environment.
          without_bundler_env do
            c.run
          end
        end
      rescue SystemExit => e
        # exit is expected in case where a script has invoked rs_shutdown
        # (command line tool or Chef resource). exit is considered to be
        # unexpected if rs_shutdown has not been called. note that it is
        # possible, but not a 'best practice', for a recipe (but not a
        # RightScript) to call rs_shutdown as an external command line utility
        # without calling exit (i.e. request a deferred reboot) and continue
        # running recipes until the list of recipes is complete. in this case,
        # the shutdown occurs after subsequent recipes have finished. the best
        # practice for a recipe is to use the rs_shutdown chef resource which
        # calls exit when appropriate.
        shutdown_request = RightScale::ShutdownRequestProxy.instance
        if shutdown_request.continue?
          report_failure('Execution failed due to rs_shutdown not being called before exit', chef_error(e))
          Log.debug(Log.format("Execution failed", e, :trace))
        else
          Log.info("Shutdown requested by script: #{shutdown_request}")
        end
      rescue Exception => e
        report_failure('Execution failed', chef_error(e))
        Log.debug(Log.format("Execution failed", e, :trace))
      ensure
        # kill the chef node provider
        RightScale::Windows::ChefNodeServer.instance.stop rescue nil if RightScale::Platform.windows?
      end
      report_success(c.node) if @ok
      true
    end
def converge(ohai)
      begin
        # When the run_list consists solely of RightScripts, adding error or report
        # handlers is not possible. Suppress these extra features as they can
        # be confusing to users. Also makes for cleaner logs.
        if @only_scripts
          ::Chef::Client.clear_notifications
        end

        if @cookbooks.size > 0
          @audit.create_new_section('Converging')
        else
          @audit.create_new_section('Preparing execution')
        end

        log_desc = "Log level is #{Log.level_to_sym(CookState.log_level)}"
        if CookState.dev_log_level
          log_desc << " (overridden by #{CookState::LOG_LEVEL_TAG}=#{CookState.dev_log_level})"
        end
        log_desc << '.'
        @audit.append_info(log_desc)
        @audit.append_info('The download once flag is set.') if CookState.download_once?

        @audit.append_info("Run list for thread #{@thread_name.inspect} contains #{@run_list.size} items.")
        @audit.append_info(@run_list.join(', '))

        attribs = { 'run_list' => @run_list }
        attribs.merge!(@attributes) if @attributes
        c      = Chef::Client.new(attribs)
        c.ohai = ohai
        audit_time do
          # Ensure that Ruby subprocesses invoked by Chef do not inherit our
          # RubyGems/Bundler environment.
          without_bundler_env do
            c.run
          end
        end
      rescue SystemExit => e
        # exit is expected in case where a script has invoked rs_shutdown
        # (command line tool or Chef resource). exit is considered to be
        # unexpected if rs_shutdown has not been called. note that it is
        # possible, but not a 'best practice', for a recipe (but not a
        # RightScript) to call rs_shutdown as an external command line utility
        # without calling exit (i.e. request a deferred reboot) and continue
        # running recipes until the list of recipes is complete. in this case,
        # the shutdown occurs after subsequent recipes have finished. the best
        # practice for a recipe is to use the rs_shutdown chef resource which
        # calls exit when appropriate.
        shutdown_request = RightScale::ShutdownRequestProxy.instance
        if shutdown_request.continue?
          report_failure('Execution failed due to rs_shutdown not being called before exit', chef_error(e))
          Log.debug(Log.format("Execution failed", e, :trace))
        else
          Log.info("Shutdown requested by script: #{shutdown_request}")
        end
      rescue Exception => e
        report_failure('Execution failed', chef_error(e))
        Log.debug(Log.format("Execution failed", e, :trace))
      ensure
        # kill the chef node provider
        RightScale::Windows::ChefNodeServer.instance.stop rescue nil if RightScale::Platform.windows?
      end
      report_success(c.node) if @ok
      true
    end
Chef converge

 === Parameters
 ohai(Ohai):: Ohai instance to be used by Chef

 === Return
 true:: Always return true