summaryrefslogtreecommitdiffstats
path: root/src/live
diff options
context:
space:
mode:
Diffstat (limited to 'src/live')
-rw-r--r--src/live/ogOperations.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py
index df13816..0998b18 100644
--- a/src/live/ogOperations.py
+++ b/src/live/ogOperations.py
@@ -49,7 +49,7 @@ class OgLiveOperations:
proc = subprocess.call(["pkill", "-9", "browser"])
proc = subprocess.Popen(["browser", "-qws", url])
except:
- logging.error('Cannot restart browser')
+ logging.exception('Cannot restart browser')
raise ValueError('Error: cannot restart browser')
def _refresh_payload_disk(self, cxt, part_setup, num_disk):
@@ -137,7 +137,7 @@ class OgLiveOperations:
r = shutil.copy(src, dst)
tip_write_csum(image_name)
except:
- logging.error('Error copying image to cache')
+ logging.exception('Error copying image to cache')
raise ValueError(f'Error: Cannot copy image {image_name} to cache')
def _restore_image_unicast(self, repo, name, devpath, cache=False):
@@ -168,6 +168,7 @@ class OgLiveOperations:
def _restore_image(self, image_path, devpath):
logging.debug(f'Restoring image at {image_path} into {devpath}')
+ logging.debug(f'This process can take some time, please *DO NOT SHUT DOWN OR REBOOT* this client')
cmd_lzop = shlex.split(f'lzop -dc {image_path}')
cmd_pc = shlex.split(f'partclone.restore -d0 -C -I -o {devpath}')
cmd_mbuffer = shlex.split('mbuffer -q -m 40M') if shutil.which('mbuffer') else None
@@ -237,7 +238,7 @@ class OgLiveOperations:
executable=OG_SHELL)
(output, error) = ogRest.proc.communicate()
except:
- logging.error('Exception when running "shell run" subprocess')
+ logging.exception('Exception when running "shell run" subprocess')
raise ValueError('Error: Incorrect command value')
if ogRest.proc.returncode != 0:
@@ -261,7 +262,7 @@ class OgLiveOperations:
executable=OG_SHELL)
(output, error) = ogRest.proc.communicate()
except:
- logging.error('Exception when running session subprocess')
+ logging.exception('Exception when running session subprocess')
raise ValueError('Error: Incorrect command value')
logging.info('Starting OS at disk %s partition %s', disk, partition)
@@ -298,7 +299,7 @@ class OgLiveOperations:
try:
inventory = get_hardware_inventory()
except ValueError as e:
- logging.error('Error occurred while running get_hardware_inventory')
+ logging.exception('Error occurred while running get_hardware_inventory')
raise e
finally:
self._restartBrowser(self._url)
@@ -456,10 +457,12 @@ class OgLiveOperations:
p2 = Popen(cmd2, stdin=p1.stdout)
p1.stdout.close()
+ logging.info(f'Running image creation process, please do not shut down or reboot the client')
+
try:
retdata = p2.communicate()
except OSError as e:
- logging.error('Unexpected error when running partclone and lzop commands')
+ logging.exception('Unexpected error when running partclone and lzop commands')
finally:
logfile.close()
p2.terminate()
@@ -473,7 +476,7 @@ class OgLiveOperations:
image_info = ogGetImageInfo(image_path)
except:
self._restartBrowser(self._url)
- logging.error('Exception when running "image create" subprocess')
+ logging.exception('Exception when running "image create" subprocess')
raise ValueError('Error: Incorrect command value')
self._write_md5_file(f'/opt/opengnsys/images/{name}.img')