diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-08-12 13:44:11 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-09-01 11:42:01 +0200 |
commit | 8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e (patch) | |
tree | ac6435b79d3e540e907bcc88e3b1c534c2945626 /ipaplatform | |
parent | fb7943dab454f358316160b4baf99075603a162d (diff) | |
download | freeipa-8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e.tar.gz freeipa-8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e.tar.xz freeipa-8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e.zip |
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 <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaplatform')
-rw-r--r-- | ipaplatform/redhat/tasks.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py index b211a31ee..3b522b026 100644 --- a/ipaplatform/redhat/tasks.py +++ b/ipaplatform/redhat/tasks.py @@ -23,6 +23,7 @@ This module contains default Red Hat OS family-specific implementations of system tasks. ''' +from __future__ import print_function import os import stat @@ -304,8 +305,8 @@ class RedHatTaskNamespace(BaseTaskNamespace): try: ipautil.run([paths.BIN_HOSTNAME, hostname]) except ipautil.CalledProcessError as e: - print >>sys.stderr, ("Failed to set this machine hostname to " - "%s (%s)." % (hostname, str(e))) + print(("Failed to set this machine hostname to " + "%s (%s)." % (hostname, str(e))), file=sys.stderr) filepath = paths.ETC_HOSTNAME if os.path.exists(filepath): @@ -341,8 +342,8 @@ class RedHatTaskNamespace(BaseTaskNamespace): # in /etc/sysconfig/network old_filepath_restore = paths.SYSCONFIG_NETWORK_IPABKP fstore.restore_file(old_filepath, old_filepath_restore) - print "Deprecated configuration file '%s' was restored to '%s'" \ - % (old_filepath, old_filepath_restore) + print("Deprecated configuration file '%s' was restored to '%s'" \ + % (old_filepath, old_filepath_restore)) hostname_was_configured = True filepath = paths.ETC_HOSTNAME |