Skip to content

Commit

Permalink
Merge pull request ceph#49713 from rhcs-dashboard/fix-sse-daemon-name
Browse files Browse the repository at this point in the history
mgr/dashboard: rgw server side encryption daemon name fix

Reviewed-by: Nizamudeen A <nia@redhat.com>
  • Loading branch information
aaSharma14 authored Jan 12, 2023
2 parents 3c63faf + f1727f0 commit cb17f28
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/pybind/mgr/dashboard/services/ceph_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,27 +189,28 @@ def get_encryption_config(cls, daemon_name):
kms_backend: str = ''
sse_s3_backend: str = ''
vault_stats = []
full_daemon_name = 'rgw.' + daemon_name

kms_backend = CephService.send_command('mon', 'config get',
who=name_to_config_section(daemon_name),
who=name_to_config_section(full_daemon_name),
key='rgw_crypt_s3_kms_backend')
sse_s3_backend = CephService.send_command('mon', 'config get',
who=name_to_config_section(daemon_name),
who=name_to_config_section(full_daemon_name),
key='rgw_crypt_sse_s3_backend')

if kms_backend.strip() == 'vault':
kms_vault_auth: str = CephService.send_command('mon', 'config get',
who=name_to_config_section(daemon_name),
who=name_to_config_section(full_daemon_name), # noqa E501 #pylint: disable=line-too-long
key='rgw_crypt_vault_auth')
kms_vault_engine: str = CephService.send_command('mon', 'config get',
who=name_to_config_section(daemon_name), # noqa E501 #pylint: disable=line-too-long
who=name_to_config_section(full_daemon_name), # noqa E501 #pylint: disable=line-too-long
key='rgw_crypt_vault_secret_engine')
kms_vault_address: str = CephService.send_command('mon', 'config get',
who=name_to_config_section(daemon_name), # noqa E501 #pylint: disable=line-too-long
who=name_to_config_section(full_daemon_name), # noqa E501 #pylint: disable=line-too-long
key='rgw_crypt_vault_addr')
kms_vault_token: str = CephService.send_command('mon', 'config get',
who=name_to_config_section(daemon_name),
key='rgw_crypt_vault_token_file')
who=name_to_config_section(full_daemon_name), # noqa E501 #pylint: disable=line-too-long
key='rgw_crypt_vault_token_file') # noqa E501 #pylint: disable=line-too-long
if (
kms_vault_auth.strip() != ""
and kms_vault_engine.strip() != ""
Expand All @@ -220,18 +221,18 @@ def get_encryption_config(cls, daemon_name):

if sse_s3_backend.strip() == 'vault':
s3_vault_auth: str = CephService.send_command('mon', 'config get',
who=name_to_config_section(daemon_name),
who=name_to_config_section(full_daemon_name), # noqa E501 #pylint: disable=line-too-long
key='rgw_crypt_sse_s3_vault_auth')
s3_vault_engine: str = CephService.send_command('mon',
'config get',
who=name_to_config_section(daemon_name),
who=name_to_config_section(full_daemon_name), # noqa E501 #pylint: disable=line-too-long
key='rgw_crypt_sse_s3_vault_secret_engine') # noqa E501 #pylint: disable=line-too-long
s3_vault_address: str = CephService.send_command('mon', 'config get',
who=name_to_config_section(daemon_name), # noqa E501 #pylint: disable=line-too-long
who=name_to_config_section(full_daemon_name), # noqa E501 #pylint: disable=line-too-long
key='rgw_crypt_sse_s3_vault_addr')
s3_vault_token: str = CephService.send_command('mon', 'config get',
who=name_to_config_section(daemon_name),
key='rgw_crypt_sse_s3_vault_token_file')
who=name_to_config_section(full_daemon_name), # noqa E501 #pylint: disable=line-too-long
key='rgw_crypt_sse_s3_vault_token_file') # noqa E501 #pylint: disable=line-too-long
if (
s3_vault_auth.strip() != ""
and s3_vault_engine.strip() != ""
Expand All @@ -248,7 +249,7 @@ def get_encryption_config(cls, daemon_name):
def set_encryption_config(cls, encryption_type, kms_provider, auth_method,
secret_engine, secret_path, namespace, address,
token, daemon_name, ssl_cert, client_cert, client_key):

full_daemon_name = 'rgw.' + daemon_name
if encryption_type == 'aws:kms':

KMS_CONFIG = [
Expand All @@ -268,7 +269,7 @@ def set_encryption_config(cls, encryption_type, kms_provider, auth_method,
if value == 'null':
continue
CephService.send_command('mon', 'config set',
who=name_to_config_section(daemon_name),
who=name_to_config_section(full_daemon_name),
name=key, value=value)

if encryption_type == 'AES256':
Expand All @@ -290,7 +291,7 @@ def set_encryption_config(cls, encryption_type, kms_provider, auth_method,
if value == 'null':
continue
CephService.send_command('mon', 'config set',
who=name_to_config_section(daemon_name),
who=name_to_config_section(full_daemon_name),
name=key, value=value)

return {}
Expand Down

0 comments on commit cb17f28

Please sign in to comment.