def call(method, path, options = {})
      self.logs = []
      clone_config = self.config.clone
      #on occation path will already have prefix (sync cancel)
      path = clone_config[:api_path] + path unless path.start_with?(clone_config[:api_path])

      headers = clone_config[:headers].clone

      get_params = options[:params] if options[:params]
      path = combine_get_params(path, get_params) if get_params

      client_options = {}
      client_options[:timeout] = clone_config[:timeout] if clone_config[:timeout]
      client_options[:open_timeout] = clone_config[:open_timeout] if clone_config[:open_timeout]
      client_options[:verify_ssl] = clone_config[:verify_ssl] unless clone_config[:verify_ssl].nil?

      if clone_config[:oauth]
        self.logger.warn('[DEPRECATION] Pulp oauth is deprecated.  Please use cert_auth instead.')
        headers = add_oauth_header(method, path, headers)
        headers['pulp-user'] = clone_config[:user]
      elsif clone_config[:cert_auth]
        if !clone_config[:cert_auth][:ssl_client_cert] || !clone_config[:cert_auth][:ssl_client_key]
          fail Runcible::ConfigurationUndefinedError, "Missing SSL certificate or key configuration."
        end
        client_options[:ssl_client_cert] = clone_config[:cert_auth][:ssl_client_cert]
        client_options[:ssl_client_key] = clone_config[:cert_auth][:ssl_client_key]
      else
        client_options[:user] = clone_config[:user]
        client_options[:password] = config[:http_auth][:password]
      end

      client_options[:ssl_ca_file] = config[:ca_cert_file] unless config[:ca_cert_file].nil?
      client = RestClient::Resource.new(clone_config[:url], client_options)

      args = [method]
      args << generate_payload(options) if [:post, :put].include?(method)
      args << headers
      starting_arg = options[:no_log_payload] == true ? 2 : 1
      self.logs << ([method.upcase, URI.join(client.url, path)] + args[starting_arg..-1]).join(': ')

      response = get_response(client, path, *args)
      processed = process_response(response)
      self.logs << "Response: #{response.code}: #{response.body}"
      log_debug
      processed
    rescue RestClient::ResourceNotFound => e
      self.logs << exception_to_log(e)
      log_info
      raise e
    rescue => e
      self.logs << exception_to_log(e)
      log_exception
      raise e
    end
def call(method, path, options = {})
      self.logs = []
      clone_config = self.config.clone
      #on occation path will already have prefix (sync cancel)
      path = clone_config[:api_path] + path unless path.start_with?(clone_config[:api_path])

      headers = clone_config[:headers].clone

      get_params = options[:params] if options[:params]
      path = combine_get_params(path, get_params) if get_params

      client_options = {}
      client_options[:timeout] = clone_config[:timeout] if clone_config[:timeout]
      client_options[:open_timeout] = clone_config[:open_timeout] if clone_config[:open_timeout]
      client_options[:verify_ssl] = clone_config[:verify_ssl] unless clone_config[:verify_ssl].nil?

      if clone_config[:oauth]
        self.logger.warn('[DEPRECATION] Pulp oauth is deprecated.  Please use cert_auth instead.')
        headers = add_oauth_header(method, path, headers)
        headers['pulp-user'] = clone_config[:user]
      elsif clone_config[:cert_auth]
        if !clone_config[:cert_auth][:ssl_client_cert] || !clone_config[:cert_auth][:ssl_client_key]
          fail Runcible::ConfigurationUndefinedError, "Missing SSL certificate or key configuration."
        end
        client_options[:ssl_client_cert] = clone_config[:cert_auth][:ssl_client_cert]
        client_options[:ssl_client_key] = clone_config[:cert_auth][:ssl_client_key]
      else
        client_options[:user] = clone_config[:user]
        client_options[:password] = config[:http_auth][:password]
      end

      client_options[:ssl_ca_file] = config[:ca_cert_file] unless config[:ca_cert_file].nil?
      client = RestClient::Resource.new(clone_config[:url], client_options)

      args = [method]
      args << generate_payload(options) if [:post, :put].include?(method)
      args << headers
      starting_arg = options[:no_log_payload] == true ? 2 : 1
      self.logs << ([method.upcase, URI.join(client.url, path)] + args[starting_arg..-1]).join(': ')

      response = get_response(client, path, *args)
      processed = process_response(response)
      self.logs << "Response: #{response.code}: #{response.body}"
      log_debug
      processed
    rescue RestClient::ResourceNotFound => e
      self.logs << exception_to_log(e)
      log_info
      raise e
    rescue => e
      self.logs << exception_to_log(e)
      log_exception
      raise e
    end
rubocop:disable Metrics/AbcSize:
 rubocop:disable PerceivedComplexity