zulip_tools: Rename may_be_perform_purging to maybe_perform_purging.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-01-12 12:52:48 -08:00 committed by Anders Kaseorg
parent d4c681a937
commit e2cc554077
3 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,7 @@ import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH) 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/") YARN_CACHE_PATH = os.path.expanduser("~/.cache/yarn/")
CURRENT_VERSION = "v6" CURRENT_VERSION = "v6"
@ -30,7 +30,7 @@ def remove_unused_versions_dir(args: argparse.Namespace) -> None:
return return
no_headings = getattr(args, "no_headings", False) no_headings = getattr(args, "no_headings", False)
may_be_perform_purging( maybe_perform_purging(
dirs_to_purge, dirs_to_purge,
{current_version_dir}, {current_version_dir},
"yarn cache", "yarn cache",

View File

@ -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_purge = get_caches_to_be_purged(caches_dir, caches_in_use, args.threshold_days)
caches_to_keep = all_caches - caches_to_purge 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 caches_to_purge, caches_to_keep, cache_type, args.dry_run, args.verbose, args.no_headings
) )
if args.verbose: if args.verbose:
@ -376,7 +376,7 @@ def generate_sha1sum_emoji(zulip_path: str) -> str:
return sha.hexdigest() return sha.hexdigest()
def may_be_perform_purging( def maybe_perform_purging(
dirs_to_purge: Set[str], dirs_to_purge: Set[str],
dirs_to_keep: Set[str], dirs_to_keep: Set[str],
dir_type: str, dir_type: str,

View File

@ -11,7 +11,7 @@ from scripts.lib import clean_unused_caches
from scripts.lib.zulip_tools import ( from scripts.lib.zulip_tools import (
DEPLOYMENTS_DIR, DEPLOYMENTS_DIR,
get_recent_deployments, get_recent_deployments,
may_be_perform_purging, maybe_perform_purging,
su_to_zulip, su_to_zulip,
) )
@ -80,7 +80,7 @@ def main() -> None:
deployments_to_keep = get_recent_deployments(args.threshold_days) deployments_to_keep = get_recent_deployments(args.threshold_days)
deployments_to_purge = get_deployments_to_be_purged(deployments_to_keep) 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 deployments_to_purge, deployments_to_keep, "deployment", args.dry_run, args.verbose, True
) )