]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool: convert print func to be py2/py3 compatible
authorNoel Power <noel.power@suse.com>
Fri, 9 Mar 2018 13:49:09 +0000 (13:49 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 23 Mar 2018 06:28:23 +0000 (07:28 +0100)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/netcmd/domain.py
python/samba/netcmd/sites.py

index d3b9b0ccf6fd9af38859e88bca2848f42aaa6cb8..963d8822e6c82b5cb9f7a91b5dfd6865bf9d5c42 100644 (file)
@@ -22,6 +22,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+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:
index 38b251ca8fe1759d0118f71d64fea2342fb6d531..aa4c86a93828c534e4b492d19575b0c56b757b5e 100644 (file)
@@ -16,6 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+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):