From 00a95bdb61aae943c670eed6fd59185546adc777 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 30 Aug 2022 17:04:41 +0200 Subject: live: rewrite image_restore Integrates image restore command into native ogClient code. Further reduces the need for external Bash scripts. After a succesful image restore, OS configuration is still using external Bash script "osConfigure/osConfigureCustom". --- src/utils/tiptorrent.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/utils/tiptorrent.py') diff --git a/src/utils/tiptorrent.py b/src/utils/tiptorrent.py index 796a665..62feb43 100644 --- a/src/utils/tiptorrent.py +++ b/src/utils/tiptorrent.py @@ -71,16 +71,13 @@ def tip_client_get(tip_addr, image_name): try: proc = subprocess.Popen(shlex.split(cmd), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + stdout=logfile, cwd='/opt/opengnsys/cache/opt/opengnsys/images/') - out, err = proc.communicate() + proc.communicate() except: - logging.error('Exception when running software inventory subprocess') + logging.error('Exception when running tiptorrent client GET subprocess') raise ValueError('Error: Incorrect command value') finally: - logging.debug(f'tip_client_get out: {out}') - logging.debug(f'tip_client_get err: {err}') logfile.close() if proc.returncode != 0: -- cgit v1.2.3-18-g5258