[8.0] Add arguments to DIRAC.initialize#6335
Conversation
|
How do the SecurityProperty enums work with extensibility? At the moment I can just use any string as a property. |
|
At the moment they wouldn't. Is anyone actually extending them? The current list in vanilla DIRAC contains (unused) LHCb specific properties. I can think of a few other ways of doing it that would allow extensions to add more properties if that's desirable though it would be good to know what the use cases are first. |
|
Someone wanted to at some point: #4077 (comment) |
| else: | ||
| gLogger.warn("Running without remote configuration") | ||
| if returnErrors: | ||
| return S_OK(errorsList) |
There was a problem hiding this comment.
This feels like it deserves a comment why errors are returned in S_OK
There was a problem hiding this comment.
I've updated the docstring to explain the situation.
8a04231 to
f07467f
Compare
andresailer
left a comment
There was a problem hiding this comment.
couple more grammar or sphinx style things.
e781ce1 to
a33c28a
Compare
fstagni
left a comment
There was a problem hiding this comment.
This is not (for me) the easiest PR to understand. I don't think there's a specific hurry here, right?
| .. _usingDIRACFromPython: | ||
|
|
||
| =============================== | ||
| Using DIRAC Clients From Python |
There was a problem hiding this comment.
What is in this rst file is IMHO not a tutorial, but rather should be part of the DIRAC developer guide.
There was a problem hiding this comment.
There are a lot of users that write python scripts against DIRAC for whom the developer documentation is excessive. I think there is a place for a tutorial that only documents clients without details about configuration/services/agents/testing.
Co-authored-by: Andre Sailer <andre.philippe.sailer@cern.ch>
a33c28a to
34aa1c9
Compare
It changes the behavour of |
In order to make
DIRAC.initializemore useful when writing scripts it needs to have arguments to expose some of the functionality which is currently only available via the command line. This pull request adds a proposal for what I think the arguments should be along with improving the user documentation by adding a tutorial on how to use the DIRAC client.To summarise the some of the new options:
require_auth: By defaultDIRAC.initializenow raises an exception if it was unable to authenticate against the CS (hopefully with a hint about why). Settingrequire_auth=Falsedisables this behavour.log_level: Allows the log level to be changed. As part of this I've also changedLogLevelto be anenum(the implementation of this could be improved but that's not a user-facing change so it doesn't need to be tied to a release).security_expression: Allows the caller to specify which properties are needed for the given users credentials. This be an expression to allow it to encode multiple paths by which the credentials can have access:I think it would be nice to replace the current constants with the
SecurityPropertyenum (and have most of this implemented in a local branch) but understand if we'd rather save that for later.In the medium term I think
LocalConfiguration/initialize/parseCommandLineshould be refactored to make much of this functionality available to scripts. This would make it possible to have scripts fail earlier when credentials are missing rather then running until the authentication errors become problematic.BEGINRELEASENOTES
*Core
NEW: DIRAC.initialize now provides keyword arguments to customise initialisation
NEW: SecurityProperty enum for expressing security properties which can be assigned to groups/hosts
NEW: LogLevel enum for choosing the logging level
ENDRELEASENOTES
Closes #6019