exit codes for kojivmd
This commit is contained in:
parent
e080e11e0a
commit
dbdeaec923
1 changed files with 7 additions and 1 deletions
|
|
@ -252,6 +252,7 @@ def main(options, session):
|
||||||
tm.restart_pending = True
|
tm.restart_pending = True
|
||||||
signal.signal(signal.SIGTERM, shutdown)
|
signal.signal(signal.SIGTERM, shutdown)
|
||||||
signal.signal(signal.SIGUSR1, restart)
|
signal.signal(signal.SIGUSR1, restart)
|
||||||
|
exit_code = 0
|
||||||
taken = False
|
taken = False
|
||||||
tm.cleanupAllVMs()
|
tm.cleanupAllVMs()
|
||||||
while True:
|
while True:
|
||||||
|
|
@ -270,6 +271,11 @@ def main(options, session):
|
||||||
raise
|
raise
|
||||||
except koji.AuthExpired:
|
except koji.AuthExpired:
|
||||||
logger.error('Session expired')
|
logger.error('Session expired')
|
||||||
|
exit_code = 1
|
||||||
|
break
|
||||||
|
except koji.AuthError:
|
||||||
|
logger.error('Authentication error')
|
||||||
|
exit_code = 1
|
||||||
break
|
break
|
||||||
except Exception:
|
except Exception:
|
||||||
# XXX - this is a little extreme
|
# XXX - this is a little extreme
|
||||||
|
|
@ -287,7 +293,7 @@ def main(options, session):
|
||||||
logger.warning("Shutting down, please wait...")
|
logger.warning("Shutting down, please wait...")
|
||||||
tm.shutdown()
|
tm.shutdown()
|
||||||
session.logout()
|
session.logout()
|
||||||
sys.exit(0)
|
sys.exit(exit_code)
|
||||||
|
|
||||||
|
|
||||||
####################
|
####################
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue