Merge "Convert fping API to processutils.execute()"

This commit is contained in:
Zuul 2018-05-09 01:22:46 +00:00 committed by Gerrit Code Review
commit 7e2f459032
3 changed files with 7 additions and 5 deletions
nova
api/openstack/compute
tests
functional/api_sample_tests
unit/api/openstack/compute

@ -20,6 +20,8 @@ import os
from webob import exc
from oslo_concurrency import processutils
from nova.api.openstack.api_version_request \
import MAX_PROXY_API_SUPPORT_VERSION
from nova.api.openstack import common
@ -30,7 +32,6 @@ from nova import compute
import nova.conf
from nova.i18n import _
from nova.policies import fping as fping_policies
from nova import utils
CONF = nova.conf.CONF
@ -48,8 +49,8 @@ class FpingController(wsgi.Controller):
@staticmethod
def fping(ips):
fping_ret = utils.execute(CONF.api.fping_path, *ips,
check_exit_code=False)
fping_ret = processutils.execute(CONF.api.fping_path, *ips,
check_exit_code=False)
if not fping_ret:
return set()
alive_ips = set()

@ -25,7 +25,8 @@ class FpingSampleJsonTests(test_servers.ServersSampleBase):
def fake_check_fping(self):
pass
self.stub_out("nova.utils.execute", test_fping.execute)
self.stub_out("oslo_concurrency.processutils.execute",
test_fping.execute)
self.stub_out("nova.api.openstack.compute.fping."
"FpingController.check_fping",
fake_check_fping)

@ -42,7 +42,7 @@ class FpingTestV21(test.TestCase):
return_servers)
self.stub_out("nova.db.instance_get_by_uuid",
return_server)
self.stub_out('nova.utils.execute',
self.stub_out('oslo_concurrency.processutils.execute',
execute)
self.stub_out("nova.api.openstack.compute.fping.FpingController."
"check_fping",