summaryrefslogtreecommitdiff
path: root/site_scons
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2021-11-10 06:09:12 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-11-10 06:42:00 +0000
commitec5eb42401c0c3141997ba6b7f3dceffcef8e7e8 (patch)
tree4d9d6136f1da68dbf15f5c530c48b1d3973bcc12 /site_scons
parent5e5ec4c7dc951ebd2d22c01275fe44c8991a1087 (diff)
downloadmongo-ec5eb42401c0c3141997ba6b7f3dceffcef8e7e8.tar.gz
SERVER-61216 validate cachedir should honor --cache-disable flag.
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/site_tools/validate_cache_dir.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/site_scons/site_tools/validate_cache_dir.py b/site_scons/site_tools/validate_cache_dir.py
index 69d1a74838a..8491b135b54 100644
--- a/site_scons/site_tools/validate_cache_dir.py
+++ b/site_scons/site_tools/validate_cache_dir.py
@@ -153,6 +153,9 @@ class CacheDirValidate(SCons.CacheDir.CacheDir):
self.CacheDebugJson({'type': cache_event}, node, cachefile)
def retrieve(self, node):
+ if not self.is_enabled():
+ return False
+
self.log_json_cachedebug(node)
try:
return super().retrieve(node)
@@ -165,6 +168,8 @@ class CacheDirValidate(SCons.CacheDir.CacheDir):
return False
def push(self, node):
+ if self.is_readonly() or not self.is_enabled():
+ return
self.log_json_cachedebug(node, pushing=True)
try:
return super().push(node)
@@ -247,6 +252,9 @@ class CacheDirValidate(SCons.CacheDir.CacheDir):
return f_out.read().decode()
def cachepath(self, node):
+ if not self.is_enabled():
+ return None, None
+
dir, path = super().cachepath(node)
if node.fs.exists(path):
return dir, path