From: Douglas Bagnall Date: Thu, 1 Feb 2018 02:28:28 +0000 (+1300) Subject: samba-tool rodc: consistently use self.outf, not stdout X-Git-Tag: tevent-0.9.36~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6f192934c8d170b1786eb2fd09560b7e02b50d4;p=thirdparty%2Fsamba.git samba-tool rodc: consistently use self.outf, not stdout This increases the output of some commands from the point of view of tests which read the outf, so we also need to change those tests a bit. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/rodc.py b/python/samba/netcmd/rodc.py index 41a7a85b712..533f9446a09 100644 --- a/python/samba/netcmd/rodc.py +++ b/python/samba/netcmd/rodc.py @@ -149,9 +149,9 @@ class cmd_rodc_preload(Command): local_samdb.transaction_commit() if len(errors) > 0: - print "\nPreload encountered problematic users:" + self.message("\nPreload encountered problematic users:") for error in errors: - print " %s" % error + self.message(" %s" % error) class cmd_rodc(SuperCommand): diff --git a/python/samba/tests/samba_tool/rodc.py b/python/samba/tests/samba_tool/rodc.py index 4851a53910a..870b5d4339e 100644 --- a/python/samba/tests/samba_tool/rodc.py +++ b/python/samba/tests/samba_tool/rodc.py @@ -104,7 +104,8 @@ class RodcCmdTestCase(SambaToolCmdTest): "--server", os.environ["DC_SERVER"], "--ignore-errors") self.assertCmdSuccess(result, out, err, "ensuring rodc prefetch ran successfully") - self.assertEqual(out, "Replicating DN CN=sambatool5,CN=Users,%s\n" % self.base_dn) + self.assertTrue(out.startswith("Replicating DN CN=sambatool5,CN=Users,%s\n" + % self.base_dn)) def test_multi_with_missing_name_failure(self): (result, out, err) = self.runsubcmd("rodc", "preload", @@ -119,7 +120,9 @@ class RodcCmdTestCase(SambaToolCmdTest): "--server", os.environ["DC_SERVER"], "--ignore-errors") self.assertCmdSuccess(result, out, err, "ensuring rodc prefetch ran successfully") - self.assertEqual(out, "Replicating DN CN=sambatool6,CN=Users,%s\nReplicating DN CN=sambatool5,CN=Users,%s\n" % (self.base_dn, self.base_dn)) + self.assertTrue(out.startswith("Replicating DN CN=sambatool6,CN=Users,%s\n" + "Replicating DN CN=sambatool5,CN=Users,%s\n" + % (self.base_dn, self.base_dn))) def test_multi_without_group_failure(self): (result, out, err) = self.runsubcmd("rodc", "preload",