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

[HTCondor-users] Environment variables parsing in Python Bindings



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