exit codes for kojivmd

This commit is contained in:
Mike McLean 2024-07-03 11:45:31 -04:00 committed by Tomas Kopecek
parent e080e11e0a
commit dbdeaec923

View file

@ -252,6 +252,7 @@ def main(options, session):
tm.restart_pending = True
signal.signal(signal.SIGTERM, shutdown)
signal.signal(signal.SIGUSR1, restart)
exit_code = 0
taken = False
tm.cleanupAllVMs()
while True:
@ -270,6 +271,11 @@ def main(options, session):
raise
except koji.AuthExpired:
logger.error('Session expired')
exit_code = 1
break
except koji.AuthError:
logger.error('Authentication error')
exit_code = 1
break
except Exception:
# XXX - this is a little extreme
@ -287,7 +293,7 @@ def main(options, session):
logger.warning("Shutting down, please wait...")
tm.shutdown()
session.logout()
sys.exit(0)
sys.exit(exit_code)
####################