Fix PY3 issue

- In PY3 the output of subprocess.Popen is a type bytes, but
strip() method requires a type str.

Story: 2008017
Task: 40669

Change-Id: I297c30044df9a94baa645a1a27de10bb49038440
This commit is contained in:
Martin Chacon Piza 2021-06-10 13:43:56 +02:00
parent 478a438654
commit 679f09a3a8
1 changed files with 1 additions and 1 deletions

View File

@ -370,7 +370,7 @@ class MySql(checks.AgentCheck):
'pid'],
stdout=subprocess.PIPE,
close_fds=True).communicate()[0]
pslines = ps.strip().split('\n')
pslines = ps.decode('utf-8').strip().split('\n')
# First line is header, second line is mysql pid
if len(pslines) == 2 and pslines[1] != '':
pid = int(pslines[1])