This commit is contained in:
Paul Edwards 2020-04-06 18:14:30 +01:00
Родитель d639747036
Коммит 9280125096
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -244,7 +244,7 @@ def __rsync(sshkey, src, dst):
]
res = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if res.returncode != 0:
logging.error("invalid returncode"+_make_subprocess_error_string(res))
log.error("invalid returncode"+_make_subprocess_error_string(res))
sys.exit(1)
def run(cfg, tmpdir, adminuser, sshprivkey, sshpubkey, fqdn):
@ -276,14 +276,14 @@ def run(cfg, tmpdir, adminuser, sshprivkey, sshpubkey, fqdn):
] + instcmd
res = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if res.returncode != 0:
logging.error("invalid returncode"+_make_subprocess_error_string(res))
log.error("invalid returncode"+_make_subprocess_error_string(res))
__rsync(sshprivkey, f"{adminuser}@{fqdn}:{tmpdir}/install/*.log", f"{tmpdir}/install/.")
sys.exit(1)
elif scripttype == "local_script":
res = subprocess.run(instcmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if res.returncode != 0:
logging.error("invalid returncode"+_make_subprocess_error_string(res))
log.error("invalid returncode"+_make_subprocess_error_string(res))
__rsync(sshprivkey, f"{adminuser}@{fqdn}:{tmpdir}/install/*.log", f"{tmpdir}/install/.")
sys.exit(1)