Adjust psutil usage for psutil > 2
psutil 2.x and above has a lot of API changes as described in: https://github.com/giampaolo/psutil/blob/master/HISTORY.rst Change-Id: I1380f488390c83a44d91b84218f1b1ba826d03a0 Closes-Bug: 1659146
This commit is contained in:
@ -110,7 +110,10 @@ class TestNeutronServer(base.BaseTestCase):
|
||||
|
||||
def safe_ppid(proc):
|
||||
try:
|
||||
return proc.ppid
|
||||
if psutil.version_info[0] == 1:
|
||||
return proc.ppid
|
||||
else:
|
||||
return proc.ppid()
|
||||
except psutil.NoSuchProcess:
|
||||
return None
|
||||
|
||||
|
Reference in New Issue
Block a user