From: Douglas Bagnall Date: Wed, 15 Jun 2022 01:23:32 +0000 (+1200) Subject: pytest/samba_tool_drs_no_dns: use TestCaseInTempDir.rm_files/.rm_dirs X-Git-Tag: talloc-2.4.0~1199 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=24f7d71416753b792d6fe029da6f366adb10383e;p=thirdparty%2Fsamba.git pytest/samba_tool_drs_no_dns: use TestCaseInTempDir.rm_files/.rm_dirs Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Reviewed-by: Noel Power --- diff --git a/source4/torture/drs/python/samba_tool_drs_no_dns.py b/source4/torture/drs/python/samba_tool_drs_no_dns.py index 33b43b48d05..fb1551a1b43 100644 --- a/source4/torture/drs/python/samba_tool_drs_no_dns.py +++ b/source4/torture/drs/python/samba_tool_drs_no_dns.py @@ -24,7 +24,6 @@ Adapted from samba_tool_drs.py """ import samba.tests -import shutil import os import ldb import drs_base @@ -47,16 +46,9 @@ class SambaToolDrsNoDnsTests(drs_base.DrsBaseTestCase): def tearDown(self): self._enable_inbound_repl(self.dnsname_dc1) - - try: - shutil.rmtree(os.path.join(self.tempdir, "private")) - shutil.rmtree(os.path.join(self.tempdir, "etc")) - shutil.rmtree(os.path.join(self.tempdir, "msg.lock")) - os.remove(os.path.join(self.tempdir, "names.tdb")) - shutil.rmtree(os.path.join(self.tempdir, "state")) - shutil.rmtree(os.path.join(self.tempdir, "bind-dns")) - except Exception: - pass + self.rm_files('names.tdb', allow_missing=True) + self.rm_dirs('etc', 'msg.lock', 'private', 'state', 'bind-dns', + allow_missing=True) super(SambaToolDrsNoDnsTests, self).tearDown()