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
This commit is contained in:
yuyafei 2016-07-04 18:06:49 +08:00
parent 8c098a1745
commit bb35821852

View File

@ -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