From e2cc554077ac80781f637d84f5d15fd9cd45f570 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 12 Jan 2022 12:52:48 -0800 Subject: [PATCH] zulip_tools: Rename may_be_perform_purging to maybe_perform_purging. Signed-off-by: Anders Kaseorg --- scripts/lib/clean_yarn_cache.py | 4 ++-- scripts/lib/zulip_tools.py | 4 ++-- scripts/purge-old-deployments | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/lib/clean_yarn_cache.py b/scripts/lib/clean_yarn_cache.py index d05a342ad7..be989c748a 100644 --- a/scripts/lib/clean_yarn_cache.py +++ b/scripts/lib/clean_yarn_cache.py @@ -6,7 +6,7 @@ import sys ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(ZULIP_PATH) -from scripts.lib.zulip_tools import may_be_perform_purging, parse_cache_script_args +from scripts.lib.zulip_tools import maybe_perform_purging, parse_cache_script_args YARN_CACHE_PATH = os.path.expanduser("~/.cache/yarn/") CURRENT_VERSION = "v6" @@ -30,7 +30,7 @@ def remove_unused_versions_dir(args: argparse.Namespace) -> None: return no_headings = getattr(args, "no_headings", False) - may_be_perform_purging( + maybe_perform_purging( dirs_to_purge, {current_version_dir}, "yarn cache", diff --git a/scripts/lib/zulip_tools.py b/scripts/lib/zulip_tools.py index 724d6f0631..2ad4cbeaa2 100755 --- a/scripts/lib/zulip_tools.py +++ b/scripts/lib/zulip_tools.py @@ -330,7 +330,7 @@ def purge_unused_caches( caches_to_purge = get_caches_to_be_purged(caches_dir, caches_in_use, args.threshold_days) caches_to_keep = all_caches - caches_to_purge - may_be_perform_purging( + maybe_perform_purging( caches_to_purge, caches_to_keep, cache_type, args.dry_run, args.verbose, args.no_headings ) if args.verbose: @@ -376,7 +376,7 @@ def generate_sha1sum_emoji(zulip_path: str) -> str: return sha.hexdigest() -def may_be_perform_purging( +def maybe_perform_purging( dirs_to_purge: Set[str], dirs_to_keep: Set[str], dir_type: str, diff --git a/scripts/purge-old-deployments b/scripts/purge-old-deployments index 11c7b8e2a0..ec6dbca2fa 100755 --- a/scripts/purge-old-deployments +++ b/scripts/purge-old-deployments @@ -11,7 +11,7 @@ from scripts.lib import clean_unused_caches from scripts.lib.zulip_tools import ( DEPLOYMENTS_DIR, get_recent_deployments, - may_be_perform_purging, + maybe_perform_purging, su_to_zulip, ) @@ -80,7 +80,7 @@ def main() -> None: deployments_to_keep = get_recent_deployments(args.threshold_days) deployments_to_purge = get_deployments_to_be_purged(deployments_to_keep) - may_be_perform_purging( + maybe_perform_purging( deployments_to_purge, deployments_to_keep, "deployment", args.dry_run, args.verbose, True )