diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-28 21:16:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-28 21:16:49 +0000 |
commit | c7191c291b318c93b4db058b7ff820cb7dc44cc7 (patch) | |
tree | 8caa842f47708dac599794745b87212e4d71df7b /collectors/python.d.plugin/python.d.plugin.in | |
parent | Releasing debian version 1.12.1-2. (diff) | |
download | netdata-c7191c291b318c93b4db058b7ff820cb7dc44cc7.tar.xz netdata-c7191c291b318c93b4db058b7ff820cb7dc44cc7.zip |
Merging upstream version 1.12.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/python.d.plugin/python.d.plugin.in')
-rw-r--r-- | collectors/python.d.plugin/python.d.plugin.in | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/collectors/python.d.plugin/python.d.plugin.in b/collectors/python.d.plugin/python.d.plugin.in index 6521fed94..240c44e0f 100644 --- a/collectors/python.d.plugin/python.d.plugin.in +++ b/collectors/python.d.plugin/python.d.plugin.in @@ -14,7 +14,7 @@ import sys import threading from re import sub -from sys import version_info, argv +from sys import version_info, argv, stdout from time import sleep GC_RUN = True @@ -40,13 +40,15 @@ sys.path.append(PYTHON_MODULES_DIR) from bases.loaders import ModuleAndConfigLoader # noqa: E402 from bases.loggers import PythonDLogger # noqa: E402 -from bases.collection import setdefault_values, run_and_exit # noqa: E402 +from bases.collection import setdefault_values, run_and_exit, safe_print # noqa: E402 try: from collections import OrderedDict except ImportError: from third_party.ordereddict import OrderedDict +IS_ATTY = stdout.isatty() + BASE_CONFIG = {'update_every': os.getenv('NETDATA_UPDATE_EVERY', 1), 'priority': 60000, 'autodetection_retry': 0, @@ -394,6 +396,10 @@ class Plugin(object): v = gc.collect() Logger.debug("GC full collection run result: {0}".format(v)) + # for exiting on SIGPIPE + if not IS_ATTY: + safe_print('\n') + def cleanup(self): for job in self.dead_jobs: self.delete_job(job) |