Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

tokens and collector.locate

It seems that if the submit host is HTC23, you need a user token in order for the API (nraorsync specifically) to locate the schedd.

import os
import classad
import htcondor

def upload_file():
    try:
        ads = classad.parseAds(open(os.environ['_CONDOR_JOB_AD'], 'r'))
        for ad in ads:
            try:
                globaljobid = str(ad['GlobalJobId'])
                print("DEBUG: globaljobid is", globaljobid)
            except:
                return(-1)
    except Exception:
        return(-1)

    print("DEBUG: upload_file(): step 1\n")
    submithost = globaljobid.split('#')[0]
    print("DEBUG: submithost is", submithost)
    collector = htcondor.Collector()
    print("DEBUG: collector is", collector)
    schedd_ad = collector.locate(htcondor.DaemonTypes.Schedd, submithost)
    print("DEBUG: schedd_ad is ", schedd_ad)

upload_file()


This code works if both the AP and EP are version 10.  But if the AP is version 23 then it fails weather the EP is verison 10 or version 23.  It works with version 23 iff I have a ~/.condor/tokens.d/nmpost token.

getnenv

Did it change since 10.0?  Can we still use getenv in DAGs or regular jobs?

...