From bb35821852c7bceb7f4a6b7c665d0c231590fd17 Mon Sep 17 00:00:00 2001 From: yuyafei Date: Mon, 4 Jul 2016 18:06:49 +0800 Subject: [PATCH] Replace raw_input with input to make PY3 compatible The raw_input() raises NameError: name 'raw_input' is not defined in python3. This patch fixes it by replacing raw_input with input to make PY3 compatible. Change-Id: I34d7608215c72d105b31293bfc6d779df47d7631 Closes-Bug: #1595827 --- ceilometer/cmd/storage.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ceilometer/cmd/storage.py b/ceilometer/cmd/storage.py index 9e181c88f0..12a27bb42b 100644 --- a/ceilometer/cmd/storage.py +++ b/ceilometer/cmd/storage.py @@ -16,6 +16,7 @@ from oslo_config import cfg from oslo_log import log +from six import moves import six.moves.urllib.parse as urlparse import sqlalchemy as sa @@ -55,9 +56,9 @@ def expirer(): def db_clean_legacy(): - confirm = raw_input("Do you really want to drop the legacy alarm tables? " - "This will destroy data definitely if it exist. " - "Please type 'YES' to confirm: ") + confirm = moves.input("Do you really want to drop the legacy alarm tables?" + "This will destroy data definitely if it exist. " + "Please type 'YES' to confirm: ") if confirm != 'YES': print("DB legacy cleanup aborted!") return