summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2019-07-03 22:14:15 +0200
committernicolargo <nicolas@nicolargo.com>2019-07-03 22:14:15 +0200
commit7edb99923addd3e74610e407072be52afbe6f804 (patch)
treea31cdecc80eb44930e8d9b97ae08b3c26006da2a
parentd32cf5bdaaa4ebdde49d341bd9ea70c78e21d2a3 (diff)
parent4ff7dc7f378d34ff219149af5b534bdee14d68ce (diff)
Merge branch 'develop' of https://github.com/nicolargo/glances into develop
-rw-r--r--docs/conf.py2
-rw-r--r--docs/objects.invbin0 -> 1909 bytes
-rw-r--r--glances/plugins/glances_docker.py20
3 files changed, 16 insertions, 6 deletions
diff --git a/docs/conf.py b/docs/conf.py
index babb8c4a..54b5bc00 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -35,7 +35,7 @@ from glances import __version__
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
#extensions = ['sphinxcontrib.autohttp.bottle']
-extensions = []
+extensions = ['sphinx.ext.intersphinx']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
diff --git a/docs/objects.inv b/docs/objects.inv
new file mode 100644
index 00000000..cca4aa50
--- /dev/null
+++ b/docs/objects.inv
Binary files differ
diff --git a/glances/plugins/glances_docker.py b/glances/plugins/glances_docker.py
index cd658680..3e628788 100644
--- a/glances/plugins/glances_docker.py
+++ b/glances/plugins/glances_docker.py
@@ -167,6 +167,10 @@ class Plugin(GlancesPlugin):
except Exception as e:
# Correct issue#649
logger.error("{} plugin - Cannot get Docker version ({})".format(self.plugin_name, e))
+ # We may have lost connection remove version info
+ if 'version' in self.stats:
+ del self.stats['version']
+ self.stats['containers'] = []
return self.stats
# Update current containers list
@@ -176,6 +180,8 @@ class Plugin(GlancesPlugin):
containers = self.docker_client.containers.list(all=self._all_tag()) or []
except Exception as e:
logger.error("{} plugin - Cannot get containers list ({})".format(self.plugin_name, e))
+ # We may have lost connection empty the containers list.
+ self.stats['containers'] = []
return self.stats
# Start new thread for new container
@@ -653,11 +659,15 @@ class ThreadDockerGrabber(threading.Thread):
Infinite loop, should be stopped by calling the stop() method
"""
- for i in self._stats_stream:
- self._stats = i
- time.sleep(0.1)
- if self.stopped():
- break
+ try:
+ for i in self._stats_stream:
+ self._stats = i
+ time.sleep(0.1)
+ if self.stopped():
+ break
+ except:
+ logger.debug("docker plugin - Exception thrown during run")
+ self.stop()
@property
def stats(self):