summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/image.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/utils/image.py b/src/utils/image.py
index a9ffb22..088c0c3 100644
--- a/src/utils/image.py
+++ b/src/utils/image.py
@@ -9,6 +9,7 @@
import ipaddress
import logging
import os
+import stat
import subprocess
import shlex
import shutil
@@ -131,11 +132,11 @@ def get_image_info(image_path):
try:
st = os.stat(image_path)
- self.size = st.st_size
- self.perms = st.st_mode & (stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
- self.mtime = int(st.st_mtime)
- except:
- logging.info(f'cannot retrieve stats from {image_path}')
+ image_info.size = st.st_size
+ image_info.perms = st.st_mode & (stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
+ image_info.mtime = int(st.st_mtime)
+ except Exception as e:
+ logging.info(f'cannot retrieve stats from {image_path}: {e}')
return image_info