diff --git a/cookiecutter.json b/cookiecutter.json index ccd32c4..ccbb204 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -1,4 +1,5 @@ { "profile_name": "htcondor", - "htcondor_log_dir": "/net/data_lhcb1b/user/jheuel/.condor_jobs" + "htcondor_log_dir": "/net/data_lhcb1b/user/jheuel/.condor_jobs", + "location_cern": false } diff --git a/{{cookiecutter.profile_name}}/grid-submit.py b/{{cookiecutter.profile_name}}/grid-submit.py index caddebe..8d81c2d 100755 --- a/{{cookiecutter.profile_name}}/grid-submit.py +++ b/{{cookiecutter.profile_name}}/grid-submit.py @@ -37,6 +37,16 @@ if request_disk is not None: sub["request_disk"] = str(request_disk) +{%- if cookiecutter.location_cern %} + +# Add kerberos credentials +# c.f. https://batchdocs.web.cern.ch/local/pythonapi.html +col = htcondor.Collector() +credd = htcondor.Credd() +credd.add_user_cred(htcondor.CredTypes.Kerberos, None) +sub["MY.SendCredential"] = "True" +{%- endif %} + schedd = htcondor.Schedd() clusterID = schedd.submit(sub)