summaryrefslogtreecommitdiff
path: root/python/samba
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2018-02-01 15:28:28 +1300
committerAndrew Bartlett <abartlet@samba.org>2018-02-09 07:59:20 +0100
commitf6f192934c8d170b1786eb2fd09560b7e02b50d4 (patch)
tree325c304ec0e3b2b970d8129b19c0c55f5111f3c3 /python/samba
parent055b7308d252d3b1501f61884defcd5bbe91049e (diff)
downloadsamba-f6f192934c8d170b1786eb2fd09560b7e02b50d4.tar.gz
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 <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python/samba')
-rw-r--r--python/samba/netcmd/rodc.py4
-rw-r--r--python/samba/tests/samba_tool/rodc.py7
2 files changed, 7 insertions, 4 deletions
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",