diff options
author | Christian Heimes <cheimes@redhat.com> | 2015-08-16 19:00:00 +0200 |
---|---|---|
committer | Christian Heimes <cheimes@redhat.com> | 2015-08-17 21:14:11 +0200 |
commit | 34664e5bc81195113e5b55ab526768a846347f5c (patch) | |
tree | c261e5434245802d75a4b41dc66130e46411fdfd /base/server | |
parent | f98ca7fa1903e12a4b2c49a70163077b3560dc1d (diff) | |
download | pki-34664e5bc81195113e5b55ab526768a846347f5c.tar.gz pki-34664e5bc81195113e5b55ab526768a846347f5c.tar.xz pki-34664e5bc81195113e5b55ab526768a846347f5c.zip |
Py3 modernization: libmodernize.fixes.fix_input_six
In Python 3 raw_input() has been renamed to input() and the old,
insecure input() builtin is gone. six.moves simplifies the transition.
It provides the former raw_input() function under the same import name
on Python 2 and 3.
Diffstat (limited to 'base/server')
-rw-r--r-- | base/server/python/pki/server/deployment/pkiconfig.py | 11 | ||||
-rw-r--r-- | base/server/python/pki/server/deployment/pkiparser.py | 4 |
2 files changed, 10 insertions, 5 deletions
diff --git a/base/server/python/pki/server/deployment/pkiconfig.py b/base/server/python/pki/server/deployment/pkiconfig.py index c22698cb6..bb99e8e31 100644 --- a/base/server/python/pki/server/deployment/pkiconfig.py +++ b/base/server/python/pki/server/deployment/pkiconfig.py @@ -21,6 +21,9 @@ # PKI Deployment Constants from __future__ import print_function +from __future__ import absolute_import +from six.moves import input # pylint: disable=W0622 + PKI_DEPLOYMENT_DEFAULT_CLIENT_DIR_PERMISSIONS = 0o0755 PKI_DEPLOYMENT_DEFAULT_DIR_PERMISSIONS = 0o0770 PKI_DEPLOYMENT_DEFAULT_EXE_PERMISSIONS = 0o0770 @@ -139,8 +142,8 @@ def prepare_for_an_external_java_debugger(instance): print(" \"address=8000,server=y,suspend=n \"") print(" \"-Djava.awt.headless=true -Xmx128M\"") print() - raw_input("Enable external java debugger 'JAVA_OPTS' " - "and press return to continue . . . ") + input("Enable external java debugger 'JAVA_OPTS' " + "and press return to continue . . . ") print() print(PKI_DEPLOYMENT_INTERRUPT_BANNER) print() @@ -155,8 +158,8 @@ def wait_to_attach_an_external_java_debugger(): print("the 'address' selected by 'JAVA_OPTS' (e. g. - port 8000) and") print("set any desired breakpoints") print() - raw_input("Please attach an external java debugger " - "and press return to continue . . . ") + input("Please attach an external java debugger " + "and press return to continue . . . ") print() print(PKI_DEPLOYMENT_INTERRUPT_BANNER) print() diff --git a/base/server/python/pki/server/deployment/pkiparser.py b/base/server/python/pki/server/deployment/pkiparser.py index 84e14bfec..fc11f54b2 100644 --- a/base/server/python/pki/server/deployment/pkiparser.py +++ b/base/server/python/pki/server/deployment/pkiparser.py @@ -35,6 +35,8 @@ import subprocess import xml.etree.ElementTree as ET from urlparse import urlparse +from six.moves import input # pylint: disable=W0622 + # PKI Imports import pki import pki.upgrade @@ -262,7 +264,7 @@ class PKIConfigParser: done = False while not done: - value = raw_input(message) + value = input(message) value = value.strip() if len(value) == 0: # empty value |