summaryrefslogtreecommitdiffstats
path: root/src/virtBootstrap/sources.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/virtBootstrap/sources.py')
-rw-r--r--src/virtBootstrap/sources.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/virtBootstrap/sources.py b/src/virtBootstrap/sources.py
index d1e9d55..b503846 100644
--- a/src/virtBootstrap/sources.py
+++ b/src/virtBootstrap/sources.py
@@ -56,8 +56,14 @@ def checksum(path, sum_type, sum_expected):
handle.close()
actual = algorithm(content).hexdigest()
- return actual == sum_expected
- except Exception:
+ if not actual == sum_expected:
+ logger.warning("File '%s' has invalid hash sum.\nExpected: %s\n"
+ "Actual: %s", path, sum_expected, actual)
+ return False
+ return True
+ except Exception as err:
+ logger.warning("Error occured while validating "
+ "the hash sum of file: %s\n%s", path, err)
return False