ExecutableService: custom command support for _get_raw_data method
lgz committed
Jul 4, 2018 at 23:32 UTC
fa291c2a65b37debdd5bce3816d59a759e4cd142
1 file changed
+2
-2
python.d/python_modules/bases/FrameworkServices/ExecutableService.py
+2
-2
@@ -17,13 +17,13 @@ class ExecutableService(SimpleService):
17
SimpleService.__init__(self, configuration=configuration, name=name)
18
self.command = None
19
20
- def _get_raw_data(self, stderr=False):
20
+ def _get_raw_data(self, stderr=False, command=None):
21
"""
22
Get raw data from executed command
23
:return: <list>
24
"""
25
try:
26
- p = Popen(self.command, stdout=PIPE, stderr=PIPE)
26
+ p = Popen(command if command else self.command, stdout=PIPE, stderr=PIPE)
27
except Exception as error:
28
self.error('Executing command {command} resulted in error: {error}'.format(command=self.command,
29
error=error))