Merge pull request #2350 from nicolargo/issue2233

fix: docker - Engine API (Unraid) failing on fetching image
This commit is contained in:
RazCrimson 2023-04-19 22:12:53 +05:30 committed by GitHub
commit 13a1ff8a1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,8 @@ import threading
import time
from copy import deepcopy
import requests.exceptions
from glances.compat import iterkeys, itervalues, nativestr, pretty_date
from glances.logger import logger
from glances.plugins.glances_plugin import GlancesPlugin
@ -252,7 +254,12 @@ class Plugin(GlancesPlugin):
# Container Id
container_stats['Id'] = container.id
# Container Image
container_stats['Image'] = container.image.tags
try:
# See issue 2233
container_stats['Image'] = container.image.tags
except requests.exceptions.HTTPError:
container_stats['Image'] = '-'
# Global stats (from attrs)
# Container Status
container_stats['Status'] = container.attrs['State']['Status']