From 8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 12 Aug 2015 13:44:11 +0200 Subject: Use the print function In Python 3, `print` is no longer a statement. Call it as a function everywhere, and include the future import to remove the statement in Python 2 code as well. Reviewed-By: Christian Heimes Reviewed-By: Jan Cholasta --- install/tools/ipa-replica-conncheck | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'install/tools/ipa-replica-conncheck') diff --git a/install/tools/ipa-replica-conncheck b/install/tools/ipa-replica-conncheck index 653dee57a..9050c8e08 100755 --- a/install/tools/ipa-replica-conncheck +++ b/install/tools/ipa-replica-conncheck @@ -18,6 +18,8 @@ # along with this program. If not, see . # +from __future__ import print_function + from ipapython.config import IPAOptionParser from ipapython import version from ipapython import ipautil @@ -54,7 +56,7 @@ class SshExec(object): def __call__(self, command, verbose=False): # Bail if ssh is not installed if self.cmd is None: - print "WARNING: ssh not installed, skipping ssh test" + print("WARNING: ssh not installed, skipping ssh test") return ('', '', 0) tmpf = tempfile.NamedTemporaryFile() @@ -91,7 +93,7 @@ BASE_PORTS = [ def print_info(msg): if not QUIET: - print msg + print(msg) def parse_options(): parser = IPAOptionParser(version=version.VERSION) @@ -285,10 +287,10 @@ def port_check(host, port_list): print_info(" %s (%d): %s" % (port.description, port.port, result)) if ports_udp_warning: - print "The following UDP ports could not be verified as open: %s" \ - % ", ".join(str(port.port) for port in ports_udp_warning) - print "This can happen if they are already bound to an application" - print "and ipa-replica-conncheck cannot attach own UDP responder." + print("The following UDP ports could not be verified as open: %s" \ + % ", ".join(str(port.port) for port in ports_udp_warning)) + print("This can happen if they are already bound to an application") + print("and ipa-replica-conncheck cannot attach own UDP responder.") if ports_failed: msg_ports = [] @@ -394,9 +396,9 @@ def main(): print_info("Check SSH connection to remote master") stdout, stderr, returncode = ssh('echo OK', verbose=True) if returncode != 0: - print 'Could not SSH into remote host. Error output:' + print('Could not SSH into remote host. Error output:') for line in stderr.splitlines(): - print ' %s' % line + print(' %s' % line) raise RuntimeError('Could not SSH to remote host.') print_info("Execute check on remote master") -- cgit