Created
September 13, 2021 06:14
-
-
Save geosmart/48648b4330a9da298ea61ae2a11f7dc8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("do klist") | |
os.system("klist") | |
krb5 = os.getenv("KRB5_CONFIG") | |
print("get krb5: {}".format(krb5)) | |
if os.getenv("KRB5_CONFIG") is not None: | |
keytab = os.getenv("KEYTAB") | |
principal = os.getenv("PRINCIPAL") | |
kinit_cmd = "env KRB5_CONFIG={} kinit -kt {} {}".format(krb5, keytab, principal) | |
print("do kinit: {}".format(kinit_cmd)) | |
os.system(kinit_cmd) | |
os.system("klist") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment