kojid: don't fail on missing ccache file

Related: https://pagure.io/koji/issue/3369
This commit is contained in:
Tomas Kopecek 2022-05-24 13:46:24 +02:00
parent 0e5b77b111
commit aae0ff2bd6

View file

@ -6624,7 +6624,7 @@ if __name__ == "__main__":
krb_principal = options.host_principal_format % socket.getfqdn()
try:
# Check ccache is not empty or authentication will fail
if os.stat(options.ccache).st_size == 0:
if os.path.exists(options.ccache) and os.stat(options.ccache).st_size == 0:
os.remove(options.ccache)
session.gssapi_login(principal=krb_principal,