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:
parent
478a438654
commit
679f09a3a8
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue