From fc53a11ce3bb34bfba2f16b1496860e01a293b48 Mon Sep 17 00:00:00 2001 From: Qiaowei Ren Date: Mon, 1 Feb 2016 14:49:05 +0800 Subject: [PATCH] Replace exit() by sys.exit() sys.exit() is considered good to use in programs. Change-Id: I2cd75a15e7ec82c502c22f0be6440b6db4c9a94a --- glance/cmd/manage.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/glance/cmd/manage.py b/glance/cmd/manage.py index 420b4f5a1b..9132491db8 100755 --- a/glance/cmd/manage.py +++ b/glance/cmd/manage.py @@ -156,14 +156,11 @@ class DbCommands(object): age_in_days = int(age_in_days) max_rows = int(max_rows) if age_in_days <= 0: - print(_("Must supply a positive, non-zero value for age.")) - exit(1) + sys.exit(_("Must supply a positive, non-zero value for age.")) if age_in_days >= (int(time.time()) / 86400): - print(_("Maximal age is count of days since epoch.")) - exit(1) + sys.exit(_("Maximal age is count of days since epoch.")) if max_rows < 1: - print(_("Minimal rows limit is 1.")) - exit(1) + sys.exit(_("Minimal rows limit is 1.")) ctx = context.get_admin_context(show_deleted=True) db_api.purge_deleted_rows(ctx, age_in_days, max_rows)