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

Re: [HTCondor-users] Environment variables parsing in Python Bindings



Hi Xiaowei,

This came up during HTCondor week in other contexts.

For the environment variables, command line arguments, and file names (as in transfer_input_files), there is no generic mechanism that can handle all special characters (I think the newline in your environment variable is causing you problems).

This likely will need to be addressed in a future HTCondor version.

That said, based on your code below, you might be able to accomplish something similar by setting

cmd_dict["getenv"] = "True"

Brian

On May 27, 2019, at 10:02 PM, JIANG Xiaowei <jiangxw@xxxxxxxxxx> wrote:

Hello All,


We met a problem about using Python Bindings to submit jobs. 


Some environment variables with special format can not be parsed normally.


Here is what we're doing on parsing environment variables:


    environment = ""
    for key in os.environ.keys():
        if "BASH_FUNC_module" in key or "TERMCAP" in key :
            continue
        environment = environment+" "+key+"="+os.environ[key].replace(' ','\' \'')

    cmd_dict["Environment"] = environment


The variable "BASH_FUNC_module" is:

BASH_FUNC_module()=() {  eval `/usr/bin/modulecmd bash $*`
}

This variable caused parsing error, we have to filter it out.


Does anyone know how we can deal with this format of variables?


Looking forward any help, thanks in advance!


Cheers,

Xiaowei



_______________________________________________
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/