src/rgw/setup/rgw.py
def _update_rgw_config_with_endpoints(conf: MappedConf, endpoints: dict, instance: int):
        """Update endpoints,port and log path values to rgw config file."""
        config_file = Rgw._get_rgw_config_path(conf)
        confstore_url = const.CONFSTORE_FILE_HANDLER + config_file
        Rgw._load_rgw_config(Rgw._conf_idx, confstore_url)
        log_path = Rgw._get_log_dir_path(conf)
        service_instance_log_file = os.path.join(log_path, f'{const.COMPONENT_NAME}-{instance}.log')
        radosgw_admin_log_file = os.path.join(log_path, 'radosgw-admin.log')

        # Update version in conf file.
        version = Rgw._get_cortx_conf(conf, const.VERSION_KEY)
        Conf.set(Rgw._conf_idx, 'release>version', version)
        # Update client.radosgw-admin section only once,
        # Update this with same config that is define for 1st instance.
        if instance == 1:
            for key, ep_value in const.RgwEndpoint.__members__.items():
                value = list(ep_value.value.values())[0]
                Conf.set(Rgw._conf_idx, f'{const.ADMIN_SECTION}>{value}', endpoints[key])
            Conf.set(Rgw._conf_idx, const.MOTR_ADMIN_FID_KEY,
                endpoints[const.RgwEndpoint.MOTR_PROCESS_FID.name])
            Conf.set(Rgw._conf_idx, const.MOTR_ADMIN_ENDPOINT_KEY,
                endpoints[const.RgwEndpoint.MOTR_CLIENT_EP.name])
            Conf.set(Rgw._conf_idx, const.RADOS_ADMIN_LOG_FILE_KEY, radosgw_admin_log_file)

        # Create separate section for each service instance in cortx_rgw.conf file.
        for key, ep_value in const.RgwEndpoint.__members__.items():
            value = list(ep_value.value.values())[0]
            Conf.set(Rgw._conf_idx, f'{const.SVC_SECTION % instance}>{value}', endpoints[key])
        Conf.set(Rgw._conf_idx, const.SVC_LOG_FILE % instance, service_instance_log_file)
        # Removed port increment support for service multiple instances.
        # (in case of multiple instances port value needs to be incremented.)
        http_port = Rgw._get_service_port(conf, 'http')
        https_port = Rgw._get_service_port(conf, 'https')
        ssl_cert_path = Rgw._get_cortx_conf(conf, const.SSL_CERT_PATH_KEY)
        Conf.set(Rgw._conf_idx, const.RGW_FRONTEND_KEY % instance,
            f'beast port={http_port} ssl_port={https_port} ssl_certificate={ssl_cert_path} ssl_private_key={ssl_cert_path}')
        Conf.save(Rgw._conf_idx)
Update endpoints,port and log path values to rgw config file.
Update endpoints,port and log path values to rgw config file.
Update endpoints port and log path values to rgw config file .
def _update_rgw_config_with_endpoints(conf: MappedConf, endpoints: dict, instance: int):
        config_file = Rgw._get_rgw_config_path(conf)
        confstore_url = const.CONFSTORE_FILE_HANDLER + config_file
        Rgw._load_rgw_config(Rgw._conf_idx, confstore_url)
        log_path = Rgw._get_log_dir_path(conf)
        service_instance_log_file = os.path.join(log_path, f'{const.COMPONENT_NAME}-{instance}.log')
        radosgw_admin_log_file = os.path.join(log_path, 'radosgw-admin.log')
        version = Rgw._get_cortx_conf(conf, const.VERSION_KEY)
        Conf.set(Rgw._conf_idx, 'release>version', version)
        if instance == 1:
            for key, ep_value in const.RgwEndpoint.__members__.items():
                value = list(ep_value.value.values())[0]
                Conf.set(Rgw._conf_idx, f'{const.ADMIN_SECTION}>{value}', endpoints[key])
            Conf.set(Rgw._conf_idx, const.MOTR_ADMIN_FID_KEY,
                endpoints[const.RgwEndpoint.MOTR_PROCESS_FID.name])
            Conf.set(Rgw._conf_idx, const.MOTR_ADMIN_ENDPOINT_KEY,
                endpoints[const.RgwEndpoint.MOTR_CLIENT_EP.name])
            Conf.set(Rgw._conf_idx, const.RADOS_ADMIN_LOG_FILE_KEY, radosgw_admin_log_file)
        for key, ep_value in const.RgwEndpoint.__members__.items():
            value = list(ep_value.value.values())[0]
            Conf.set(Rgw._conf_idx, f'{const.SVC_SECTION % instance}>{value}', endpoints[key])
        Conf.set(Rgw._conf_idx, const.SVC_LOG_FILE % instance, service_instance_log_file)
        http_port = Rgw._get_service_port(conf, 'http')
        https_port = Rgw._get_service_port(conf, 'https')
        ssl_cert_path = Rgw._get_cortx_conf(conf, const.SSL_CERT_PATH_KEY)
        Conf.set(Rgw._conf_idx, const.RGW_FRONTEND_KEY % instance,
            f'beast port={http_port} ssl_port={https_port} ssl_certificate={ssl_cert_path} ssl_private_key={ssl_cert_path}')
        Conf.save(Rgw._conf_idx)
def _update_rgw_config_with_endpoints ( conf : MappedConf , endpoints : dict , instance : int ) : config_file = Rgw . _get_rgw_config_path ( conf ) confstore_url = const . CONFSTORE_FILE_HANDLER + config_file Rgw . _load_rgw_config ( Rgw . _conf_idx , confstore_url ) log_path = Rgw . _get_log_dir_path ( conf ) service_instance_log_file = os . path . join ( log_path , f'{const.COMPONENT_NAME}-{instance}.log' ) radosgw_admin_log_file = os . path . join ( log_path , 'radosgw-admin.log' ) version = Rgw . _get_cortx_conf ( conf , const . VERSION_KEY ) Conf . set ( Rgw . _conf_idx , 'release>version' , version ) if instance == 1 : for key , ep_value in const . RgwEndpoint . __members__ . items ( ) : value = list ( ep_value . value . values ( ) ) [ 0 ] Conf . set ( Rgw . _conf_idx , f'{const.ADMIN_SECTION}>{value}' , endpoints [ key ] ) Conf . set ( Rgw . _conf_idx , const . MOTR_ADMIN_FID_KEY , endpoints [ const . RgwEndpoint . MOTR_PROCESS_FID . name ] ) Conf . set ( Rgw . _conf_idx , const . MOTR_ADMIN_ENDPOINT_KEY , endpoints [ const . RgwEndpoint . MOTR_CLIENT_EP . name ] ) Conf . set ( Rgw . _conf_idx , const . RADOS_ADMIN_LOG_FILE_KEY , radosgw_admin_log_file ) for key , ep_value in const . RgwEndpoint . __members__ . items ( ) : value = list ( ep_value . value . values ( ) ) [ 0 ] Conf . set ( Rgw . _conf_idx , f'{const.SVC_SECTION % instance}>{value}' , endpoints [ key ] ) Conf . set ( Rgw . _conf_idx , const . SVC_LOG_FILE % instance , service_instance_log_file ) http_port = Rgw . _get_service_port ( conf , 'http' ) https_port = Rgw . _get_service_port ( conf , 'https' ) ssl_cert_path = Rgw . _get_cortx_conf ( conf , const . SSL_CERT_PATH_KEY ) Conf . set ( Rgw . _conf_idx , const . RGW_FRONTEND_KEY % instance , f'beast port={http_port} ssl_port={https_port} ssl_certificate={ssl_cert_path} ssl_private_key={ssl_cert_path}' ) Conf . save ( Rgw . _conf_idx )
Update endpoints,port and log path values to rgw config file.
Update endpoints port and log path values to rgw config file .
"""Update endpoints,port and log path values to rgw config file.""" # Update version in conf file. # Update client.radosgw-admin section only once, # Update this with same config that is define for 1st instance. # Create separate section for each service instance in cortx_rgw.conf file. # Removed port increment support for service multiple instances. # (in case of multiple instances port value needs to be incremented.)
conf
MappedConf
endpoints
dict
instance
int