src/rgw/setup/rgw.py
def _parse_endpoint_values(conf: MappedConf, instance: int, client_instance_count: int, svc_name: str):
        """Fetch endpoint values from hctl fetch-fids."""
        hare_config_dir = Rgw._get_hare_config_path(conf)
        fetch_fids_cmd = f'hctl fetch-fids -c {hare_config_dir}'
        decoded_out = Rgw._run_fetch_fid_cmd(fetch_fids_cmd)
        Rgw._validate_hctl_cmd_response(decoded_out, svc_name)

        endpoints = [comp for comp in decoded_out if comp['name'] == svc_name]
        # RGW client_instance_count should be equal/less than the
        # no of rgw config elements present in hctl fetch-fids output.
        if len(endpoints) < client_instance_count:
            raise SetupError(errno.EINVAL,
                f'The count of {svc_name} elements in hctl-fetch-fids o/p '
                f'does not match with the {svc_name} client instance count.')
        # Fetch endpoints based on instance,
        # for eg. for instance=1 read 0th index rgw config list from output and so on.
        index = instance - 1
        endpoints = endpoints[index]

        for ep_key, ep_value in const.RgwEndpoint.__members__.items():
            if list(ep_value.value.keys())[0] in endpoints:
                endpoints[ep_key] = endpoints.pop(list(ep_value.value.keys())[0])

        return endpoints
Fetch endpoint values from hctl fetch-fids.
Fetch endpoint values from hctl fetch-fids.
Fetch endpoint values from hctl fetch - fids .
def _parse_endpoint_values(conf: MappedConf, instance: int, client_instance_count: int, svc_name: str):
        hare_config_dir = Rgw._get_hare_config_path(conf)
        fetch_fids_cmd = f'hctl fetch-fids -c {hare_config_dir}'
        decoded_out = Rgw._run_fetch_fid_cmd(fetch_fids_cmd)
        Rgw._validate_hctl_cmd_response(decoded_out, svc_name)
        endpoints = [comp for comp in decoded_out if comp['name'] == svc_name]
        if len(endpoints) < client_instance_count:
            raise SetupError(errno.EINVAL,
                f'The count of {svc_name} elements in hctl-fetch-fids o/p '
                f'does not match with the {svc_name} client instance count.')
        index = instance - 1
        endpoints = endpoints[index]
        for ep_key, ep_value in const.RgwEndpoint.__members__.items():
            if list(ep_value.value.keys())[0] in endpoints:
                endpoints[ep_key] = endpoints.pop(list(ep_value.value.keys())[0])
        return endpoints
def _parse_endpoint_values ( conf : MappedConf , instance : int , client_instance_count : int , svc_name : str ) : hare_config_dir = Rgw . _get_hare_config_path ( conf ) fetch_fids_cmd = f'hctl fetch-fids -c {hare_config_dir}' decoded_out = Rgw . _run_fetch_fid_cmd ( fetch_fids_cmd ) Rgw . _validate_hctl_cmd_response ( decoded_out , svc_name ) endpoints = [ comp for comp in decoded_out if comp [ 'name' ] == svc_name ] if len ( endpoints ) < client_instance_count : raise SetupError ( errno . EINVAL , f'The count of {svc_name} elements in hctl-fetch-fids o/p ' f'does not match with the {svc_name} client instance count.' ) index = instance - 1 endpoints = endpoints [ index ] for ep_key , ep_value in const . RgwEndpoint . __members__ . items ( ) : if list ( ep_value . value . keys ( ) ) [ 0 ] in endpoints : endpoints [ ep_key ] = endpoints . pop ( list ( ep_value . value . keys ( ) ) [ 0 ] ) return endpoints
Fetch endpoint values from hctl fetch-fids.
Fetch endpoint values from hctl fetch - fids .
"""Fetch endpoint values from hctl fetch-fids.""" # RGW client_instance_count should be equal/less than the # no of rgw config elements present in hctl fetch-fids output. # Fetch endpoints based on instance, # for eg. for instance=1 read 0th index rgw config list from output and so on.
conf
MappedConf
instance
int
client_instance_count
int
svc_name
str