Replace exit() by sys.exit()

exit() is used for interactive shell, it relies on the site module.
sys.exit() is considered good to use in programs.

Trivial-fix

Change-Id: Ie05e4da082d6eae87c75200c78da68d9a18c19a7
This commit is contained in:
caoyue 2016-01-25 17:20:07 +08:00
parent cbc99485fc
commit 5f06f15ad7
1 changed files with 2 additions and 2 deletions

View File

@ -171,7 +171,7 @@ def _db_error(caught_exception):
print(_("The above error may show that the database has not "
"been created.\nPlease create a database using "
"'cinder-manage db sync' before running this command."))
exit(1)
sys.exit(1)
class HostCommands(object):
@ -226,7 +226,7 @@ class DbCommands(object):
age_in_days = int(age_in_days)
if age_in_days <= 0:
print(_("Must supply a positive, non-zero value for age"))
exit(1)
sys.exit(1)
ctxt = context.get_admin_context()
db.purge_deleted_rows(ctxt, age_in_days)