Skip to content

Commit

Permalink
[Docker plugin] KeyError: 'mem' cause 'Exception in ASGI application' #…
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed Jan 25, 2025
1 parent 233a47e commit 4a4cb13
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions glances/plugins/containers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ def update_views(self) -> bool:
if alert == 'DEFAULT':
# Not found ? Get back to default CPU threshold value
alert = self.get_alert(i['cpu']['total'], header='cpu')
self.views[i[self.get_key()]]['cpu']['decoration'] = alert
if 'cpu' in self.views[i[self.get_key()]]:
self.views[i[self.get_key()]]['cpu']['decoration'] = alert
# MEM alert
if 'memory' in i and 'usage' in i['memory']:
# Looking for specific MEM container threshold in the conf file
Expand All @@ -286,7 +287,8 @@ def update_views(self) -> bool:
alert = self.get_alert(
self.memory_usage_no_cache(i['memory']), maximum=i['memory']['limit'], header='mem'
)
self.views[i[self.get_key()]]['mem']['decoration'] = alert
if 'mem' in self.views[i[self.get_key()]]:
self.views[i[self.get_key()]]['mem']['decoration'] = alert

# Display Engine and Pod name ?
show_pod_name = False
Expand Down

0 comments on commit 4a4cb13

Please sign in to comment.