mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Return None directly if we try to calculate the hash of a file that does not exists
This commit is contained in:
parent
6ef6783c81
commit
d77c616d71
1 changed files with 5 additions and 1 deletions
|
@ -713,6 +713,10 @@ def _get_files_diff(orig_file, new_file, as_string=False, skip_header=True):
|
||||||
|
|
||||||
def _calculate_hash(path):
|
def _calculate_hash(path):
|
||||||
"""Calculate the MD5 hash of a file"""
|
"""Calculate the MD5 hash of a file"""
|
||||||
|
|
||||||
|
if not os.path.exists(path):
|
||||||
|
return None
|
||||||
|
|
||||||
hasher = hashlib.md5()
|
hasher = hashlib.md5()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -889,7 +893,7 @@ def _get_journalctl_logs(service):
|
||||||
import traceback
|
import traceback
|
||||||
return "error while get services logs from journalctl:\n%s" % traceback.format_exc()
|
return "error while get services logs from journalctl:\n%s" % traceback.format_exc()
|
||||||
|
|
||||||
|
|
||||||
def manually_modified_files_compared_to_debian_default():
|
def manually_modified_files_compared_to_debian_default():
|
||||||
|
|
||||||
# from https://serverfault.com/a/90401
|
# from https://serverfault.com/a/90401
|
||||||
|
|
Loading…
Add table
Reference in a new issue