[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Dynamically changing HTCondor configuration when using python binding



Hey Marco,

For 1), you can change the interpreter's environment so htcondor.reload_config() will respect that. For example, on a test CE:

# python -c 'import htcondor; import os; print htcondor.param["COLLECTOR_HOST"]; os.environ["CONDOR_CONFIG"] = "/etc/condor-ce/condor_config"; htcondor.reload_config(); print htcondor.param["COLLECTOR_HOST"]'
fermicloud068.fnal.gov
fermicloud068.fnal.gov:9619
- Brian

On 12/5/19 5:58 PM, Marco Mambelli wrote:
Greetings,
I'm using some HTCondor commands from a python program either wrapping the binaries or using the bindings (when available).

I need to change dynamically and programmatically some configuration parameters.
When wrapping the commands I'm using os.environ[] to set variables like CONDOR_CONFIG or _CONDOR_... 
This works because the commands are in a subshell.

os.environ is not affecting the current environment (of the running interpreter) and the python bindings are executed there, therefore ignoring these changes. I'd like to avoid to have to re-invoke the interpreter in a subprocess.


1. Is it there a way to specify a config file to htcondor.reload_config(), e.g the path in CONDOR_CONFIG from os.environ, not from the environment at the invocation of the python interpreter?

2. And then should I modify the content of htcondor.param (_Param object) with what is in the _CONDOR_... variables?

3. Is it there another better way to change the configuration when using the bindings?


Thank you,
Marco


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/