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

Re: [HTCondor-users] interpolation using the python bindings



It looks like this indicates that the Python bindings don't parse and expand submit variables it finds in the dictionary.

# So I ran the following Python:

import sys

import htcondor

schedd = htcondor.Schedd()
submit = htcondor.Submit({
    'executable'            : '/bin/sleep',
    'arguments'             : '60',
    '+special1'             : '$(Cluster)',
    '+special2'             : '"$(Cluster)"',
    '+special3'             : ' $(Cluster) ',
    '+special4'             : ' "$(Cluster)" ',
    '+special5'             : ' " $(Cluster) " ',
    'transfer_executable'   : 'false',
    'should_transfer_files' : 'false',
    'log'                   : 'jc.log'
})

try:
    with schedd.transaction() as txn:
        cluster_id = submit.queue(txn, 1)
except Exception as e:
    print("Job submission failed for an unknown error: " + str(e))
    sys.exit(-1)

sys.exit(0)

# and got the following results --
# 'PYTHONPATH=~/condor/install/lib/python python ./jc.py ; condor_q -l | grep special'

special1 = 853
special2 = "853"
special3 = 853
special4 = "853"
special5 = " 853 "

From which you can observe that Condor does some strange things, but not
expanding macros is really just not one of them (at least for the version of the bindings I tried with). Jose, could you post a small, ideally minimal, version of the code that's giving you trouble?

- ToddM