From: Noel Power Date: Fri, 9 Mar 2018 13:49:09 +0000 (+0000) Subject: samba-tool: convert print func to be py2/py3 compatible X-Git-Tag: talloc-2.1.13~275 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aacbe1b65ccf6f75d26bcae517632e09552f23ca;p=thirdparty%2Fsamba.git samba-tool: convert print func to be py2/py3 compatible Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index d3b9b0ccf6f..963d8822e6c 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -22,6 +22,7 @@ # along with this program. If not, see . # +from __future__ import print_function import samba.getopt as options import ldb import string @@ -354,9 +355,9 @@ class cmd_domain_provision(Command): def ask(prompt, default=None): if default is not None: - print "%s [%s]: " % (prompt, default), + print("%s [%s]: " % (prompt, default), end=' ') else: - print "%s: " % (prompt,), + print("%s: " % (prompt,), end=' ') return sys.stdin.readline().rstrip("\n") or default try: diff --git a/python/samba/netcmd/sites.py b/python/samba/netcmd/sites.py index 38b251ca8fe..aa4c86a9382 100644 --- a/python/samba/netcmd/sites.py +++ b/python/samba/netcmd/sites.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # +from __future__ import print_function from samba import sites, subnets from samba.samdb import SamDB import samba.getopt as options @@ -208,8 +209,8 @@ class cmd_sites_subnet_set_site(Command): raise CommandError("Error assigning subnet %s to site %s: %s" % (subnetname, site_of_subnet, e)) - print >> self.outf, ("Subnet %s shifted to site %s" % - (subnetname, site_of_subnet)) + print(("Subnet %s shifted to site %s" % + (subnetname, site_of_subnet)), file=self.outf) class cmd_sites_subnet(SuperCommand):