summaryrefslogtreecommitdiffstats
path: root/src/live/ogOperations.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-05-27 16:26:48 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-05-30 17:22:23 +0200
commit914bd993fcb347a24d65e64ba838cb34f72ab14d (patch)
tree21ff8b3d62bac4b9a95cd51d254194ce450da3ce /src/live/ogOperations.py
parent34007857f6b96eca02c510a8a4d8fce6d37fa8df (diff)
src: cleanup ogGetImageInfo
Rename ogGetImageInfo to get_image_info. Move code from ogOperations.py to obtain image data into get_image_info.
Diffstat (limited to 'src/live/ogOperations.py')
-rw-r--r--src/live/ogOperations.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py
index 04b4433..6e528f8 100644
--- a/src/live/ogOperations.py
+++ b/src/live/ogOperations.py
@@ -545,7 +545,7 @@ class OgLiveOperations:
if os.access(f'{image_path}', os.R_OK) == False:
raise OgError(f'Cannot access partclone image file {image_path}')
- image_info = ogGetImageInfo(image_path)
+ image_info = get_image_info(image_path)
except Exception as e:
if os.path.exists(image_path):
os.unlink(image_path)
@@ -560,21 +560,6 @@ class OgLiveOperations:
else:
raise
- try:
- st = os.stat(image_path)
- size = st.st_size
- perms = st.st_mode & (stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
- mtime = int(st.st_mtime)
- except:
- logging.info(f'cannot retrieve stats from {image_path}')
- size = 0
- perms = 0
- mtime = 0
-
- image_info.size = size
- image_info.perms = perms
- image_info.mtime = mtime
-
if self._write_md5_file(f'/opt/opengnsys/images/{name}.img') == -1:
raise OgError(f'Cannot write {name}.full.sum file')