Hi ,
You can write a wrapper script to use the python3 available on your system to execute the custom commands.
import os
import subprocess
_NEW_PYTHON_PATH = '/opt/rh/python27/root/usr/bin'
_SPLUNK_PYTHON_PATH = os.environ['PYTHONPATH']
os.environ['PYTHONPATH'] = _NEW_PYTHON_PATH
my_process = os.path.join(os.getcwd(), 'test.py')
p = subprocess.Popen([os.environ['PYTHONPATH'], my_process, _SPLUNK_PYTHON_PATH],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.communicate()[0]
print output
... View more