summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Samuels <richard.l.samuels@gmail.com>2021-10-07 18:46:42 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-09 03:21:59 +0000
commitc83d89bef13f8ddfeda2a5336fec287c590b5c37 (patch)
treedea42f1c79bf6a13da8576521dee42012f1fb908
parent2d512f84a57bcaf3613273bc0ff00d290d4a19a6 (diff)
downloadmongo-c83d89bef13f8ddfeda2a5336fec287c590b5c37.tar.gz
SERVER-60523 Standalone fixture incorrectly handles directory creation exceptions
(cherry picked from commit d5010cf9e5b712f96c1a2c6539e303687b202f8a)
-rw-r--r--buildscripts/resmokelib/testing/fixtures/standalone.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/buildscripts/resmokelib/testing/fixtures/standalone.py b/buildscripts/resmokelib/testing/fixtures/standalone.py
index 19925edb6be..d563a313703 100644
--- a/buildscripts/resmokelib/testing/fixtures/standalone.py
+++ b/buildscripts/resmokelib/testing/fixtures/standalone.py
@@ -56,11 +56,7 @@ class MongoDFixture(interface.Fixture):
if not self.preserve_dbpath and os.path.lexists(self._dbpath):
shutil.rmtree(self._dbpath, ignore_errors=False)
- try:
- os.makedirs(self._dbpath)
- except os.error:
- # Directory already exists.
- pass
+ os.makedirs(self._dbpath, exist_ok=True)
launcher = MongodLauncher(self.fixturelib)
# Second return val is the port, which we ignore because we explicitly created the port above.