Skip to content

fix (DIRAC): ensure host credentials passed to DIRAC.initialize are not ignored in case passed as list#8130

Closed
ryuwd wants to merge 1 commit intoDIRACGrid:integrationfrom
ryuwd:roneil-fix-host-cred-setting
Closed

fix (DIRAC): ensure host credentials passed to DIRAC.initialize are not ignored in case passed as list#8130
ryuwd wants to merge 1 commit intoDIRACGrid:integrationfrom
ryuwd:roneil-fix-host-cred-setting

Conversation

@ryuwd
Copy link
Copy Markdown
Contributor

@ryuwd ryuwd commented Apr 7, 2025

will be hotfixed on cvmfs

cc @fstagni

BEGINRELEASENOTES

*DIRAC
FIX: ensure host credentials are not ignored in case passed as a list and not a tuple

ENDRELEASENOTES

@ryuwd ryuwd requested review from atsareg and fstagni as code owners April 7, 2025 13:54
Comment thread src/DIRAC/__init__.py
Comment on lines +230 to +236
if isinstance(
host_credentials,
(
tuple,
list,
),
):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if isinstance(
host_credentials,
(
tuple,
list,
),
):
if isinstance(host_credentials, (tuple, list)):

@fstagni
Copy link
Copy Markdown
Contributor

fstagni commented Apr 7, 2025

Please rebase also.

Comment thread src/DIRAC/__init__.py
if isinstance(host_credentials, tuple):
gConfigurationData.setOptionInCFG("/DIRAC/Security/CertFile", str(host_credentials[0]))
gConfigurationData.setOptionInCFG("/DIRAC/Security/KeyFile", str(host_credentials[1]))
if isinstance(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this if shouldnt' exist at all, it doesn't even match the type hint.

@fstagni Can you take care of it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is used being used to set UseServerCertificate = yes then set it in the config file next to CertFile/KeyFile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I added in 2fd668d in order to run these tests using the certificates from standard location. This was a quick way of doing it, if you want something cleaner I would suggest to add another parameter (boolean) to initialize for only setting UseServerCertificate (all test calls should then be updated).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fstagni
Copy link
Copy Markdown
Contributor

fstagni commented Apr 7, 2025

I think that can replaced by #8131. Comment if you don't think so.

@fstagni fstagni closed this Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants