def clear_state
      output_dir_paths = []
      [:user_metadata, :cloud_metadata].each do |kind|
        output_dir_paths |= metadata_writers(kind).map { |w| w.output_dir_path }
      end

      last_exception = nil
      output_dir_paths.each do |output_dir_path|
        begin
          FileUtils.rm_rf(output_dir_path) if File.directory?(output_dir_path)
        rescue Exception => e
          last_exception = e
        end
      end
      fail(last_exception.message) if last_exception
      return ActionResult.new
    rescue Exception => e
      return ActionResult.new(:exitstatus => 1, :error => "ERROR: #{e.message}", :exception => e)
    end
def clear_state
      output_dir_paths = []
      [:user_metadata, :cloud_metadata].each do |kind|
        output_dir_paths |= metadata_writers(kind).map { |w| w.output_dir_path }
      end

      last_exception = nil
      output_dir_paths.each do |output_dir_path|
        begin
          FileUtils.rm_rf(output_dir_path) if File.directory?(output_dir_path)
        rescue Exception => e
          last_exception = e
        end
      end
      fail(last_exception.message) if last_exception
      return ActionResult.new
    rescue Exception => e
      return ActionResult.new(:exitstatus => 1, :error => "ERROR: #{e.message}", :exception => e)
    end
Attempts to clear any files generated by writers.

 === Return
 always true

 === Raise
 CloudError:: on failure to clean state