Set config based on discovered data

def set_auto_configuration(config, hostname, ca_cert, proxy, is_satellite):
    """
    Set config based on discovered data
    """
    logger.debug("Attempting to auto configure!")
    logger.debug("Attempting to auto configure hostname: %s", hostname)
    logger.debug("Attempting to auto configure CA cert: %s", ca_cert)
    logger.debug("Attempting to auto configure proxy: %s", proxy)
    saved_base_url = config.base_url
    if ca_cert is not None:
        saved_cert_verify = config.cert_verify
        config.cert_verify = ca_cert
    if proxy is not None:
        saved_proxy = config.proxy
        config.proxy = proxy
    if is_satellite:
        # satellite
        config.base_url = hostname + '/r/insights'
        if not config.legacy_upload:
            config.base_url += '/platform'
        logger.debug('Auto-configured base_url: %s', config.base_url)
    else:
        # connected directly to RHSM
        if config.legacy_upload:
            config.base_url = hostname + '/r/insights'
        else:
            config.base_url = hostname + '/api'
        logger.debug('Auto-configured base_url: %s', config.base_url)
        logger.debug('Not connected to Satellite, skipping branch_info')
        # direct connection to RHSM, skip verify_connectivity
        return

    if not verify_connectivity(config):
        logger.warn("Could not auto configure, falling back to static config")
        logger.warn("See %s for additional information",
                    constants.default_log_file)
        config.base_url = saved_base_url
        if proxy is not None:
            if saved_proxy is not None and saved_proxy.lower() == 'none':
                saved_proxy = None
            config.proxy = saved_proxy
        if ca_cert is not None:
            config.cert_verify = saved_cert_verify