mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
handle errors on removing paths on macos if they don't exist
This commit is contained in:
parent
9d80605623
commit
1e319f84fc
1 changed files with 7 additions and 3 deletions
|
@ -350,9 +350,13 @@ def salt_onedir(
|
|||
pip_bin = onedir_env / "bin" / "pip3"
|
||||
ctx.run(str(pip_bin), "install", str(salt_archive))
|
||||
if platform == "darwin":
|
||||
shutil.rmtree(onedir_env / "opt")
|
||||
shutil.rmtree(onedir_env / "etc")
|
||||
shutil.rmtree(onedir_env / "Library")
|
||||
|
||||
def errfn(fn, path, err):
|
||||
ctx.info(f"Removing {path} failed: {err}")
|
||||
|
||||
shutil.rmtree(onedir_env / "opt", onerror=errfn)
|
||||
shutil.rmtree(onedir_env / "etc", onerror=errfn)
|
||||
shutil.rmtree(onedir_env / "Library", onerror=errfn)
|
||||
|
||||
|
||||
def _check_pkg_build_files_exist(ctx: Context, **kwargs):
|
||||
|
|
Loading…
Add table
Reference in a new issue