summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
authorJavier Hernandez <jhernandez@soleta.eu>2024-01-10 10:00:14 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-01-10 11:26:59 +0100
commit58b5b2eca00acc14510dbf2c741f12d7e799a264 (patch)
treec790ad1f5835e6f9bc0a82947eed63327283ad36 /ogcp
parent58852f68aa79b56da815b46864d7da2343feebba (diff)
views: Warn user when no logs available
Warn user if trying to access the logs of a client that don't yet exist. This is prefered to showing the backtrace to the user.
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/views.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index b83abb4..b124287 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -2100,6 +2100,9 @@ def action_legacy_log():
return redirect(url_for('commands'))
ip = ips.pop()
log_file = Path("/opt/opengnsys/log/clients/" + str(ip) + ".log")
+ if not os.access(log_file, os.R_OK):
+ flash(_('No log available for this client yet'), category='error')
+ return redirect(url_for('commands'))
log = log_file.read_text()
if log:
scopes, clients = get_scopes(set(ips))