repl whitespaces with _ in job names
lgz committed
Dec 29, 2016 at 10:22 UTC
d86183acfc9a9ef1f23dde9201f4f6e1cc1ff5af
1 file changed
+2
-1
plugins.d/python.d.plugin
+2
-1
@@ -9,6 +9,7 @@ import os
9
import sys
10
import time
11
import threading
12
+from re import sub
13
14
# -----------------------------------------------------------------------------
15
# globals & environment setup
@@ -340,7 +341,7 @@ class PythonCharts(object):
341
i += 1
342
try:
343
if job.override_name is not None:
343
- new_name = job.__module__ + '_' + job.override_name
344
+ new_name = job.__module__ + '_' + sub(r'\s+', '_', job.override_name)
345
if new_name in overridden:
346
msg.info("DROPPED:", job.name, ", job '" + job.override_name + "' is already served by another job.")
347
self._stop(job)