summaryrefslogtreecommitdiffstats
path: root/base/server/python/pki/server/deployment/pkiparser.py
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2015-08-16 19:00:00 +0200
committerChristian Heimes <cheimes@redhat.com>2015-08-17 21:14:11 +0200
commitf98ca7fa1903e12a4b2c49a70163077b3560dc1d (patch)
treea3446113d3a7d32c5ce79b1b359d5353ec49afee /base/server/python/pki/server/deployment/pkiparser.py
parent71148b8f79a5d6ba0c949a3ca0acf5aec6321f0a (diff)
downloadpki-f98ca7fa1903e12a4b2c49a70163077b3560dc1d.tar.gz
pki-f98ca7fa1903e12a4b2c49a70163077b3560dc1d.tar.xz
pki-f98ca7fa1903e12a4b2c49a70163077b3560dc1d.zip
Py3 modernization: libmodernize.fixes.fix_print
Replace print statement with Python 3's print() function. For Python 2 'from __future__ import print_function' turns the print statement into Python 3 compatible print function. See https://www.python.org/dev/peps/pep-3105/
Diffstat (limited to 'base/server/python/pki/server/deployment/pkiparser.py')
-rw-r--r--base/server/python/pki/server/deployment/pkiparser.py33
1 files changed, 17 insertions, 16 deletions
diff --git a/base/server/python/pki/server/deployment/pkiparser.py b/base/server/python/pki/server/deployment/pkiparser.py
index 08815a6b1..84e14bfec 100644
--- a/base/server/python/pki/server/deployment/pkiparser.py
+++ b/base/server/python/pki/server/deployment/pkiparser.py
@@ -21,6 +21,7 @@
# System Imports
from __future__ import absolute_import
+from __future__ import print_function
import ConfigParser
import argparse
import getpass
@@ -136,20 +137,20 @@ class PKIConfigParser:
if len(config.pki_root_prefix) > 0:
if not os.path.exists(config.pki_root_prefix) or \
not os.path.isdir(config.pki_root_prefix):
- print "ERROR: " + \
- log.PKI_DIRECTORY_MISSING_OR_NOT_A_DIRECTORY_1 % \
- config.pki_root_prefix
- print
+ print("ERROR: " +
+ log.PKI_DIRECTORY_MISSING_OR_NOT_A_DIRECTORY_1 %
+ config.pki_root_prefix)
+ print()
self.arg_parser.print_help()
self.arg_parser.exit(-1)
# always default that configuration file exists
if not os.path.exists(config.default_deployment_cfg) or \
not os.path.isfile(config.default_deployment_cfg):
- print "ERROR: " + \
- log.PKI_FILE_MISSING_OR_NOT_A_FILE_1 % \
- config.default_deployment_cfg
- print
+ print("ERROR: " +
+ log.PKI_FILE_MISSING_OR_NOT_A_FILE_1 %
+ config.default_deployment_cfg)
+ print()
self.arg_parser.print_help()
self.arg_parser.exit(-1)
@@ -157,10 +158,10 @@ class PKIConfigParser:
# verify user configuration file exists
if not os.path.exists(config.user_deployment_cfg) or \
not os.path.isfile(config.user_deployment_cfg):
- print "ERROR: " + \
- log.PKI_FILE_MISSING_OR_NOT_A_FILE_1 % \
- config.user_deployment_cfg
- print
+ print("ERROR: " +
+ log.PKI_FILE_MISSING_OR_NOT_A_FILE_1 %
+ config.user_deployment_cfg)
+ print()
self.arg_parser.print_help()
self.arg_parser.exit(-1)
@@ -247,7 +248,7 @@ class PKIConfigParser:
config.user_config.set(section, key, value)
def print_text(self, message):
- print ' ' * self.indent + message
+ print(' ' * self.indent + message)
def read_text(self, message, section=None, key=None, default=None,
options=None, sign=':', allow_empty=True,
@@ -337,8 +338,8 @@ class PKIConfigParser:
'pki_replicationdb_password',
'pki_security_domain_password')
- print 'Loading deployment configuration from ' + \
- config.user_deployment_cfg + '.'
+ print('Loading deployment configuration from ' +
+ config.user_deployment_cfg + '.')
self.pki_config.read([config.user_deployment_cfg])
config.user_config.read([config.user_deployment_cfg])
@@ -372,7 +373,7 @@ class PKIConfigParser:
except ConfigParser.NoOptionError:
continue
except ConfigParser.ParsingError as err:
- print err
+ print(err)
rv = err
return rv