feat: 修改重复的删除目录的逻辑

pull/13010/head
Aaron3S 8 months ago committed by Bryan
parent 3740a4ad6f
commit 2ac87e4ad6

@ -314,7 +314,7 @@ class BasePlaybookManager:
def delete_runtime_dir(self): def delete_runtime_dir(self):
if settings.DEBUG_DEV: if settings.DEBUG_DEV:
return return
shutil.rmtree(self.runtime_dir) shutil.rmtree(self.runtime_dir, ignore_errors=True)
def run(self, *args, **kwargs): def run(self, *args, **kwargs):
print(">>> 任务准备阶段\n") print(">>> 任务准备阶段\n")

@ -39,7 +39,7 @@ PROJECT_DIR = const.PROJECT_DIR
APPS_DIR = os.path.join(PROJECT_DIR, 'apps') APPS_DIR = os.path.join(PROJECT_DIR, 'apps')
DATA_DIR = os.path.join(PROJECT_DIR, 'data') DATA_DIR = os.path.join(PROJECT_DIR, 'data')
SHARE_DIR = os.path.join(DATA_DIR, 'share') SHARE_DIR = os.path.join(DATA_DIR, 'share')
ANSIBLE_DIR = os.path.join(DATA_DIR, 'ansible') ANSIBLE_DIR = os.path.join(SHARE_DIR, 'ansible')
CERTS_DIR = os.path.join(DATA_DIR, 'certs') CERTS_DIR = os.path.join(DATA_DIR, 'certs')
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production

@ -145,7 +145,7 @@ class DeployAppletHostManager:
def delete_runtime_dir(self): def delete_runtime_dir(self):
if settings.DEBUG_DEV: if settings.DEBUG_DEV:
return return
shutil.rmtree(self.run_dir) shutil.rmtree(self.run_dir, ignore_errors=True)
def _run(self, cb_func: callable, **kwargs): def _run(self, cb_func: callable, **kwargs):
try: try:

Loading…
Cancel
Save