src/rgw/setup/rgw.py
def _update_hax_endpoint(conf: MappedConf, data_pod_hostname: str):
        """Update hax endpoint values in rgw config file."""
        Log.info('Reading motr_ha_endpoint from data pod')

        if not data_pod_hostname:
            raise SetupError(errno.EINVAL, 'Invalid data pod hostname: %s', data_pod_hostname)

        hare_config_dir = Rgw._get_hare_config_path(conf)
        fetch_fids_cmd = f'hctl fetch-fids -c {hare_config_dir} --node {data_pod_hostname}'
        decoded_out = Rgw._run_fetch_fid_cmd(fetch_fids_cmd, data_pod_hostname)
        Rgw._validate_hctl_cmd_response(decoded_out, 'hax')
        motr_ha_endpoint = [endpoints['ep'] for endpoints in decoded_out \
            if 'hax' in endpoints.values()][0]
        Log.info(f'Fetched motr_ha_endpoint from data pod. Endpoint: {motr_ha_endpoint}')

        config_path = Rgw._get_rgw_config_path(conf)
        confstore_url = const.CONFSTORE_FILE_HANDLER + config_path
        Rgw._load_rgw_config(Rgw._conf_idx, confstore_url)
        ha_ep_key = list(const.RgwEndpoint.MOTR_HA_EP.value.values())[0]
        Conf.set(Rgw._conf_idx, f'client.radosgw-admin>{ha_ep_key}', motr_ha_endpoint)
        Conf.save(Rgw._conf_idx)

        Log.info(f'Updated motr_ha_endpoint in config file {config_path}')
Update hax endpoint values in rgw config file.
Update hax endpoint values in rgw config file.
Update hax endpoint values in rgw config file .
def _update_hax_endpoint(conf: MappedConf, data_pod_hostname: str):
        Log.info('Reading motr_ha_endpoint from data pod')
        if not data_pod_hostname:
            raise SetupError(errno.EINVAL, 'Invalid data pod hostname: %s', data_pod_hostname)
        hare_config_dir = Rgw._get_hare_config_path(conf)
        fetch_fids_cmd = f'hctl fetch-fids -c {hare_config_dir} --node {data_pod_hostname}'
        decoded_out = Rgw._run_fetch_fid_cmd(fetch_fids_cmd, data_pod_hostname)
        Rgw._validate_hctl_cmd_response(decoded_out, 'hax')
        motr_ha_endpoint = [endpoints['ep'] for endpoints in decoded_out \
            if 'hax' in endpoints.values()][0]
        Log.info(f'Fetched motr_ha_endpoint from data pod. Endpoint: {motr_ha_endpoint}')
        config_path = Rgw._get_rgw_config_path(conf)
        confstore_url = const.CONFSTORE_FILE_HANDLER + config_path
        Rgw._load_rgw_config(Rgw._conf_idx, confstore_url)
        ha_ep_key = list(const.RgwEndpoint.MOTR_HA_EP.value.values())[0]
        Conf.set(Rgw._conf_idx, f'client.radosgw-admin>{ha_ep_key}', motr_ha_endpoint)
        Conf.save(Rgw._conf_idx)
        Log.info(f'Updated motr_ha_endpoint in config file {config_path}')
def _update_hax_endpoint ( conf : MappedConf , data_pod_hostname : str ) : Log . info ( 'Reading motr_ha_endpoint from data pod' ) if not data_pod_hostname : raise SetupError ( errno . EINVAL , 'Invalid data pod hostname: %s' , data_pod_hostname ) hare_config_dir = Rgw . _get_hare_config_path ( conf ) fetch_fids_cmd = f'hctl fetch-fids -c {hare_config_dir} --node {data_pod_hostname}' decoded_out = Rgw . _run_fetch_fid_cmd ( fetch_fids_cmd , data_pod_hostname ) Rgw . _validate_hctl_cmd_response ( decoded_out , 'hax' ) motr_ha_endpoint = [ endpoints [ 'ep' ] for endpoints in decoded_out if 'hax' in endpoints . values ( ) ] [ 0 ] Log . info ( f'Fetched motr_ha_endpoint from data pod. Endpoint: {motr_ha_endpoint}' ) config_path = Rgw . _get_rgw_config_path ( conf ) confstore_url = const . CONFSTORE_FILE_HANDLER + config_path Rgw . _load_rgw_config ( Rgw . _conf_idx , confstore_url ) ha_ep_key = list ( const . RgwEndpoint . MOTR_HA_EP . value . values ( ) ) [ 0 ] Conf . set ( Rgw . _conf_idx , f'client.radosgw-admin>{ha_ep_key}' , motr_ha_endpoint ) Conf . save ( Rgw . _conf_idx ) Log . info ( f'Updated motr_ha_endpoint in config file {config_path}' )
Update hax endpoint values in rgw config file.
Update hax endpoint values in rgw config file .
"""Update hax endpoint values in rgw config file."""
conf
MappedConf
data_pod_hostname
str