mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Gotta feed the file path, not the file itself
This commit is contained in:
parent
f462a22b27
commit
c6f653822e
1 changed files with 12 additions and 13 deletions
|
@ -180,21 +180,20 @@ def log_display(path, number=50, share=False):
|
||||||
|
|
||||||
# Display metadata if exist
|
# Display metadata if exist
|
||||||
if os.path.exists(md_path):
|
if os.path.exists(md_path):
|
||||||
with open(md_path, "r") as md_file:
|
try:
|
||||||
try:
|
metadata = read_yaml(md_path)
|
||||||
metadata = read_yaml(md_file)
|
except MoulinetteError as e:
|
||||||
except MoulinetteError as e:
|
error = m18n.n('log_corrupted_md_file', md_file=md_path, error=e)
|
||||||
error = m18n.n('log_corrupted_md_file', md_file=md_path, error=e)
|
if os.path.exists(log_path):
|
||||||
if os.path.exists(log_path):
|
logger.warning(error)
|
||||||
logger.warning(error)
|
|
||||||
else:
|
|
||||||
raise YunohostError(error)
|
|
||||||
else:
|
else:
|
||||||
infos['metadata_path'] = md_path
|
raise YunohostError(error)
|
||||||
infos['metadata'] = metadata
|
else:
|
||||||
|
infos['metadata_path'] = md_path
|
||||||
|
infos['metadata'] = metadata
|
||||||
|
|
||||||
if 'log_path' in metadata:
|
if 'log_path' in metadata:
|
||||||
log_path = metadata['log_path']
|
log_path = metadata['log_path']
|
||||||
|
|
||||||
# Display logs if exist
|
# Display logs if exist
|
||||||
if os.path.exists(log_path):
|
if os.path.exists(log_path):
|
||||||
|
|
Loading…
Add table
Reference in a new issue