Convert libvirt's RBD storage to using processutils.execute()
Nova's utils.execute() is just a redirector now and should go away, so I am progressively moving things over to calling processutils directly. Change-Id: I745b3433a447aeec819781e0ee26df6e6c70530a blueprint: execs-ive-had-a-few
This commit is contained in:
parent
17976b4aed
commit
517cbd0815
|
@ -19,7 +19,6 @@ from nova import exception
|
|||
from nova import objects
|
||||
from nova import test
|
||||
from nova.tests import uuidsentinel as uuids
|
||||
from nova import utils
|
||||
from nova.virt.libvirt.storage import rbd_utils
|
||||
from nova.virt.libvirt import utils as libvirt_utils
|
||||
|
||||
|
@ -173,7 +172,7 @@ class RbdTestCase(test.NoDBTestCase):
|
|||
self.driver.is_cloneable(location, image_meta))
|
||||
self.assertTrue(mock_get_fsid.called)
|
||||
|
||||
@mock.patch.object(utils, 'execute')
|
||||
@mock.patch('oslo_concurrency.processutils.execute')
|
||||
def test_get_mon_addrs(self, mock_execute):
|
||||
mock_execute.return_value = (CEPH_MON_DUMP, '')
|
||||
hosts = ['::1', '::1', '::1', '127.0.0.1', 'example.com']
|
||||
|
|
|
@ -24,6 +24,7 @@ except ImportError:
|
|||
rados = None
|
||||
rbd = None
|
||||
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_log import log as logging
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_service import loopingcall
|
||||
|
@ -32,7 +33,6 @@ from oslo_utils import units
|
|||
|
||||
from nova import exception
|
||||
from nova.i18n import _
|
||||
from nova import utils
|
||||
from nova.virt.libvirt import utils as libvirt_utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -162,7 +162,7 @@ class RBDDriver(object):
|
|||
|
||||
def get_mon_addrs(self):
|
||||
args = ['ceph', 'mon', 'dump', '--format=json'] + self.ceph_args()
|
||||
out, _ = utils.execute(*args)
|
||||
out, _ = processutils.execute(*args)
|
||||
lines = out.split('\n')
|
||||
if lines[0].startswith('dumped monmap epoch'):
|
||||
lines = lines[1:]
|
||||
|
@ -326,7 +326,7 @@ class RBDDriver(object):
|
|||
# we need to use it explicitly.
|
||||
args += ['--image-format=2']
|
||||
args += self.ceph_args()
|
||||
utils.execute('rbd', 'import', *args)
|
||||
processutils.execute('rbd', 'import', *args)
|
||||
|
||||
def _destroy_volume(self, client, volume, pool=None):
|
||||
"""Destroy an RBD volume, retrying as needed.
|
||||
|
|
Loading…
Reference in New Issue