Skip to content

Commit

Permalink
keylime_tenant non-zero exit code on error
Browse files Browse the repository at this point in the history
Now that we are catching errors and making them more user-friendly
we still need to exit with a non-zero exit code so that other
programs can tell when something went wrong

Signed-off-by: Michael Peters <[email protected]>
  • Loading branch information
mpeters committed Mar 22, 2022
1 parent c07cf0a commit 85b0cf1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions keylime/cmd/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
Copyright 2017 Massachusetts Institute of Technology.
'''

import sys

from keylime import keylime_logging
from keylime import tenant

Expand All @@ -16,8 +18,10 @@ def main():
tenant.main()
except tenant.UserError as ue:
logger.error(str(ue))
sys.exit(1)
except Exception as e:
logger.exception(e)
sys.exit(1)


if __name__ == "__main__":
Expand Down
3 changes: 2 additions & 1 deletion packit-ci.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
how: fmf
url: https://github.com/RedHat-SP-Security/keylime-tests
ref: main
test:
test:
- /setup/configure_tpm_emulator
- /setup/install_upstream_keylime
- /setup/enable_keylime_coverage
Expand All @@ -21,6 +21,7 @@
- /functional/db-postgresql-sanity-on-localhost
- /functional/db-mariadb-sanity-on-localhost
- /functional/db-mysql-sanity-on-localhost
- /functional/tenant-allowlist-sanity
- /setup/generate_coverage_report

adjust:
Expand Down

0 comments on commit 85b0cf1

Please sign in to comment.