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
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):
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)