From f8a224a63fbb350454cbc31dd20fea0111eb814f Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 25 Jan 2017 00:54:26 +0100 Subject: [PATCH] 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 --- neutron/tests/functional/test_server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neutron/tests/functional/test_server.py b/neutron/tests/functional/test_server.py index 04234283f47..7eb66d4663f 100644 --- a/neutron/tests/functional/test_server.py +++ b/neutron/tests/functional/test_server.py @@ -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