添加keys 发布接口

This commit is contained in:
pengtao 2019-11-05 14:04:36 +08:00
parent 043812f70e
commit fdc40c8c8f

View File

@ -30,10 +30,6 @@ class DeployKeys:
def run(self):
svn_path, ipadr = self.get_config()
if svn_path:
shutil.rmtree(svn_path)
else:
pass
os.system(f"mkdir -p {svn_path}")
key_path = f"{svn_path}/keys"
args = dict()
tar_file = self.build_svn_tar(key_path)
@ -44,6 +40,8 @@ class DeployKeys:
self.ansible_deploy(args)
else:
log.error(f"tar file no found with {self.project}")
else:
raise Exception(f"{self.project} config not found in manager table!")
def get_config(self):
@ -76,6 +74,9 @@ class DeployKeys:
try:
log.info("svn export config start")
s = svn.remote.RemoteClient(svn_path)
if self.svn_paths:
shutil.rmtree(self.svn_paths)
s.export(self.svn_paths, force=True)
log.info("svn export config success")
except Exception: