diff --git a/glance/tests/functional/test_reload.py b/glance/tests/functional/test_reload.py index 4c7acfb1a0..62d51a2df5 100644 --- a/glance/tests/functional/test_reload.py +++ b/glance/tests/functional/test_reload.py @@ -76,7 +76,12 @@ class TestReload(functional.FunctionalTest): pid = None pid = self._get_parent(server) process = psutil.Process(pid) - children = process.get_children() + try: + # psutils version >= 2 + children = process.children() + except AttributeError: + # psutils version < 2 + children = process.get_children() pids = set() for child in children: pids.add(child.pid) diff --git a/glance/tests/functional/v1/test_multiprocessing.py b/glance/tests/functional/v1/test_multiprocessing.py index 0a8034296a..8c7c0685a6 100644 --- a/glance/tests/functional/v1/test_multiprocessing.py +++ b/glance/tests/functional/v1/test_multiprocessing.py @@ -47,8 +47,12 @@ class TestMultiprocessing(functional.FunctionalTest): def _get_children(self): api_pid = self.api_server.process_pid process = psutil.Process(api_pid) - - children = process.get_children() + try: + # psutils version >= 2 + children = process.children() + except AttributeError: + # psutils version < 2 + children = process.get_children() pids = [str(child.pid) for child in children] return pids