For every excption raised in utils.execute(), a new instance is created.
This patch removes this redundant step and directly uses exceptions
defined in Oslo.
Change-Id: I1425d7f1d69a8fde8fde29444fae4d12d045b730
from cinder.backup.driver import BackupDriver
from cinder import exception
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import units
from cinder import utils
import cinder.volume.drivers as drivers
cmd.extend([path, '-'])
try:
out, err = self._execute(*cmd)
- except (exception.ProcessExecutionError,
- exception.UnknownArgumentError) as exc:
+ except (processutils.ProcessExecutionError,
+ processutils.UnknownArgumentError) as exc:
LOG.info(_("rbd export-diff failed - %s") % (str(exc)))
raise exception.BackupRBDOperationFailed("rbd export-diff failed")
cmd.extend(['-', self._utf8("%s/%s" % (dest_pool, dest_name))])
try:
out, err = self._execute(*cmd, process_input=out)
- except (exception.ProcessExecutionError,
- exception.UnknownArgumentError) as exc:
+ except (processutils.ProcessExecutionError,
+ processutils.UnknownArgumentError) as exc:
LOG.info(_("rbd import-diff failed - %s") % (str(exc)))
raise exception.BackupRBDOperationFailed("rbd import-diff failed")
import os
import stat
+from oslo.config import cfg
+
from cinder.backup.driver import BackupDriver
from cinder import exception
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import utils
-from oslo.config import cfg
LOG = logging.getLogger(__name__)
utils.execute('ln', volume_path, backup_path,
run_as_root=True,
check_exit_code=True)
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
err = (_('backup: %(vol_id)s Failed to create device hardlink '
'from %(vpath)s to %(bpath)s.\n'
'stdout: %(out)s\n stderr: %(err)s')
'-f',
hardlink_path,
run_as_root=True)
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
err = (_('backup: %(vol_id)s Failed to remove backup hardlink'
' from %(vpath)s to %(bpath)s.\n'
'stdout: %(out)s\n stderr: %(err)s')
volume_id)
try:
self._do_backup(backup_path, volume_id)
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
err = (_('backup: %(vol_id)s Failed to run dsmc '
'on %(bpath)s.\n'
'stdout: %(out)s\n stderr: %(err)s')
try:
self._do_restore(restore_path, volume_id)
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
err = (_('restore: %(vol_id)s Failed to run dsmc '
'on %(bpath)s.\n'
'stdout: %(out)s\n stderr: %(err)s')
run_as_root=True,
check_exit_code=False)
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
err = (_('delete: %(vol_id)s Failed to run dsmc with '
'stdout: %(out)s\n stderr: %(err)s')
% {'vol_id': volume_id,
super(ConvertedException, self).__init__()
-class ProcessExecutionError(processutils.ProcessExecutionError):
- pass
-
-
-class UnknownArgumentError(processutils.UnknownArgumentError):
- pass
-
-
class Error(Exception):
pass
from cinder import exception
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import utils
LOG = logging.getLogger(__name__)
attempts=attempts,
run_as_root=run_as_root,
check_exit_code=check_exit_code)
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
LOG.debug(_('Faked command raised an exception %s'), e)
raise
from cinder import db
from cinder import exception
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import test
from cinder.tests.backup.fake_rados import mock_rados
from cinder.tests.backup.fake_rados import mock_rbd
return db.backup_create(self.ctxt, backup)['id']
def fake_execute_w_exception(*args, **kwargs):
- raise exception.ProcessExecutionError()
+ raise processutils.ProcessExecutionError()
def time_inc(self):
self.counter += 1
from cinder import db
from cinder import exception
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils as putils
from cinder import test
from cinder import utils
kwargs = self._cmd_to_dict(cmd)
if kwargs['cmd'] != 'dsmc' or kwargs['type'] not in cmd_switch:
- raise exception.ProcessExecutionError(exit_code=1,
- stdout='',
- stderr='Not dsmc command',
- cmd=' '.join(cmd))
+ raise putils.ProcessExecutionError(exit_code=1,
+ stdout='',
+ stderr='Not dsmc command',
+ cmd=' '.join(cmd))
out, err, ret = cmd_switch[kwargs['type']](**kwargs)
return (out, err, ret)
err = ''
ret = 0
else:
- raise exception.ProcessExecutionError(exit_code=1,
- stdout='',
- stderr='Unsupported command',
- cmd=' '.join(cmd))
+ raise putils.ProcessExecutionError(exit_code=1,
+ stdout='',
+ stderr='Unsupported command',
+ cmd=' '.join(cmd))
return (out, err, ret)
def error_injection(self, cmd, error):
out, err, ret = SIM.exec_cmd(cmd)
if ret and check_exit_code:
- raise exception.ProcessExecutionError(
+ raise putils.ProcessExecutionError(
exit_code=-1,
stdout=out,
stderr=err,
from cinder import context
from cinder import exception
-from cinder.exception import ProcessExecutionError
+from cinder.openstack.common import processutils as putils
from cinder import test
from cinder import units
from cinder.volume import configuration as conf
drv._execute('mkdir', '-p', self.TEST_MNT_POINT)
drv._execute('mount', '-t', 'glusterfs', self.TEST_EXPORT1,
self.TEST_MNT_POINT, run_as_root=True).\
- AndRaise(ProcessExecutionError(
+ AndRaise(putils.ProcessExecutionError(
stderr='is busy or already mounted'))
mox.ReplayAll()
self.TEST_EXPORT1,
self.TEST_MNT_POINT,
run_as_root=True). \
- AndRaise(ProcessExecutionError(stderr='is busy or '
- 'already mounted'))
+ AndRaise(putils.ProcessExecutionError(stderr='is busy or '
+ 'already mounted'))
mox.ReplayAll()
- self.assertRaises(ProcessExecutionError, drv._mount_glusterfs,
+ self.assertRaises(putils.ProcessExecutionError, drv._mount_glusterfs,
self.TEST_EXPORT1, self.TEST_MNT_POINT,
ensure=False)
from cinder.image import image_utils
from cinder.openstack.common import importutils
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import test
from cinder import utils
from cinder.volume import configuration as conf
pass
def _fake_is_not_gpfs_path(self, path):
- raise(exception.ProcessExecutionError('invalid gpfs path'))
+ raise(processutils.ProcessExecutionError('invalid gpfs path'))
def _fake_convert_image(self, source, dest, out_format):
utils.execute('cp', source, dest)
from cinder import context
from cinder import exception
-from cinder.exception import ProcessExecutionError
+from cinder.openstack.common import processutils as putils
from cinder import test
from cinder import units
drv._execute('mkdir', '-p', self.TEST_MNT_POINT)
drv._execute('mount', '-t', 'nfs', self.TEST_NFS_EXPORT1,
self.TEST_MNT_POINT, run_as_root=True).\
- AndRaise(ProcessExecutionError(
+ AndRaise(putils.ProcessExecutionError(
stderr='is busy or already mounted'))
mox.ReplayAll()
'-t',
'nfs',
self.TEST_NFS_EXPORT1, self.TEST_MNT_POINT, run_as_root=True).\
- AndRaise(ProcessExecutionError(stderr='is busy or '
- 'already mounted'))
+ AndRaise(putils.ProcessExecutionError(stderr='is busy or '
+ 'already mounted'))
mox.ReplayAll()
- self.assertRaises(ProcessExecutionError, drv._mount_nfs,
+ self.assertRaises(putils.ProcessExecutionError, drv._mount_nfs,
self.TEST_NFS_EXPORT1, self.TEST_MNT_POINT,
ensure=False)
from cinder import exception
from cinder.image import image_utils
+from cinder.openstack.common import processutils
from cinder import test
from cinder import units
from cinder.volume.drivers.sheepdog import SheepdogDriver
def test_update_volume_stats_error(self):
def fake_stats(*args):
- raise exception.ProcessExecutionError()
+ raise processutils.ProcessExecutionError()
self.stubs.Set(self.driver, '_execute', fake_stats)
expected = dict(
volume_backend_name='sheepdog',
from cinder import exception
from cinder.openstack.common import excutils
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import test
from cinder import units
from cinder import utils
out, err = ('', 'ERROR: Unsupported command')
if (check_exit_code) and (len(err) != 0):
- raise exception.ProcessExecutionError(exit_code=1,
- stdout=out,
- stderr=err,
- cmd=' '.join(cmd))
+ raise processutils.ProcessExecutionError(exit_code=1,
+ stdout=out,
+ stderr=err,
+ cmd=' '.join(cmd))
return (out, err)
LOG.debug(_('CLI output:\n stdout: %(stdout)s\n stderr: '
'%(stderr)s') % {'stdout': stdout, 'stderr': stderr})
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
with excutils.save_and_reraise_exception():
LOG.debug(_('CLI Exception output:\n stdout: %(out)s\n '
'stderr: %(err)s') % {'out': e.stdout,
return attrs
def _fail_prepare_fc_map(self, fc_map_id, source, target):
- raise exception.ProcessExecutionError(exit_code=1,
- stdout='',
- stderr='unit-test-fail',
- cmd='prestartfcmap id')
+ raise processutils.ProcessExecutionError(exit_code=1,
+ stdout='',
+ stderr='unit-test-fail',
+ cmd='prestartfcmap id')
def test_storwize_svc_snapshots(self):
vol1 = self._generate_vol_info(None, None)
# Test prestartfcmap, startfcmap, and rmfcmap failing
orig = self.driver._call_prepare_fc_map
self.driver._call_prepare_fc_map = self._fail_prepare_fc_map
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(processutils.ProcessExecutionError,
self.driver.create_snapshot, snap1)
self.driver._call_prepare_fc_map = orig
if self.USESIM:
self.sim.error_injection('lsfcmap', 'speed_up')
self.sim.error_injection('startfcmap', 'bad_id')
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(processutils.ProcessExecutionError,
self.driver.create_snapshot, snap1)
self._assert_vol_exists(snap1['name'], False)
self.sim.error_injection('prestartfcmap', 'bad_id')
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(processutils.ProcessExecutionError,
self.driver.create_snapshot, snap1)
self._assert_vol_exists(snap1['name'], False)
# Fail the snapshot
orig = self.driver._call_prepare_fc_map
self.driver._call_prepare_fc_map = self._fail_prepare_fc_map
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(processutils.ProcessExecutionError,
self.driver.create_volume_from_snapshot,
vol2, snap1)
self.driver._call_prepare_fc_map = orig
self.assertEqual(attributes['mdisk_grp_name'], pool)
# Try to create the volume again (should fail)
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(processutils.ProcessExecutionError,
self.driver.create_volume,
volume)
self.assertNotEqual(attrs[k], v)
else:
self.assertEqual(attrs[k], v)
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
if 'CMMVC7050E' not in e.stderr:
raise
self.driver.initialize_connection(volume1, self._connector)
# Try to delete the 1st volume (should fail because it is mapped)
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(processutils.ProcessExecutionError,
self.driver.delete_volume,
volume1)
if self.USESIM and False:
snap = self._generate_vol_info(master['name'], master['id'])
self.sim.error_injection('startfcmap', 'bad_id')
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(processutils.ProcessExecutionError,
self.driver.create_snapshot, snap)
self._assert_vol_exists(snap['name'], False)
volfs = self._generate_vol_info(None, None)
self.sim.error_injection('startfcmap', 'bad_id')
self.sim.error_injection('lsfcmap', 'speed_up')
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(processutils.ProcessExecutionError,
self.driver.create_volume_from_snapshot,
volfs, snap)
self._assert_vol_exists(volfs['name'], False)
clone = self._generate_vol_info(None, None)
self.sim.error_injection('startfcmap', 'bad_id')
self.sim.error_injection('lsfcmap', 'speed_up')
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(processutils.ProcessExecutionError,
self.driver.create_cloned_volume,
clone, volfs)
self._assert_vol_exists(clone['name'], False)
''')
fp.close()
os.chmod(tmpfilename, 0o755)
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(putils.ProcessExecutionError,
utils.execute,
tmpfilename, tmpfilename2, attempts=10,
process_input='foo',
os.unlink(tmpfilename2)
def test_unknown_kwargs_raises_error(self):
- self.assertRaises(exception.UnknownArgumentError,
+ self.assertRaises(putils.UnknownArgumentError,
utils.execute,
'/usr/bin/env', 'true',
this_is_not_a_valid_kwarg=True)
def test_check_exit_code_boolean(self):
utils.execute('/usr/bin/env', 'false', check_exit_code=False)
- self.assertRaises(exception.ProcessExecutionError,
+ self.assertRaises(putils.ProcessExecutionError,
utils.execute,
'/usr/bin/env', 'false', check_exit_code=True)
def test_read_file_as_root(self):
def fake_execute(*args, **kwargs):
if args[1] == 'bad':
- raise exception.ProcessExecutionError
+ raise putils.ProcessExecutionError
return 'fakecontents', None
self.stubs.Set(utils, 'execute', fake_execute)
"""Convenience wrapper around oslo's execute() method."""
if 'run_as_root' in kwargs and not 'root_helper' in kwargs:
kwargs['root_helper'] = get_root_helper()
- try:
- (stdout, stderr) = processutils.execute(*cmd, **kwargs)
- except processutils.ProcessExecutionError as ex:
- raise exception.ProcessExecutionError(
- exit_code=ex.exit_code,
- stderr=ex.stderr,
- stdout=ex.stdout,
- cmd=ex.cmd,
- description=ex.description)
- except processutils.UnknownArgumentError as ex:
- raise exception.UnknownArgumentError(ex.message)
- return (stdout, stderr)
+ return processutils.execute(*cmd, **kwargs)
def check_ssh_injection(cmd_list):
try:
out, _err = execute('cat', file_path, run_as_root=True)
return out
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
raise exception.FileNotFound(file_path=file_path)
from cinder.openstack.common import excutils
from cinder.openstack.common import fileutils
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import utils
from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import utils as volume_utils
try:
self._execute(*command, **kwargs)
return True
- except exception.ProcessExecutionError as ex:
+ except processutils.ProcessExecutionError as ex:
tries = tries + 1
if tries >= self.configuration.num_shell_tries or\
out, info = None, None
try:
out, info = self._execute(*cmd, run_as_root=True)
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
LOG.error(_("Failed to access the device on the path "
"%(path)s: %(error)s.") %
{"path": path, "error": e.stderr})
# code "inspired by" nova/virt/libvirt/volume.py
try:
self._run_iscsiadm(iser_properties, ())
- except exception.ProcessExecutionError as exc:
+ except processutils.ProcessExecutionError as exc:
# iscsiadm returns 21 for "No records found" after version 2.0-871
if exc.exit_code in [21, 255]:
self._run_iscsiadm(iser_properties, ('--op', 'new'))
try:
self._run_iscsiadm(iser_properties, ("--login",),
check_exit_code=[0, 255])
- except exception.ProcessExecutionError as err:
+ except processutils.ProcessExecutionError as err:
if err.exit_code in [15]:
self._iscsiadm_update(iser_properties,
"node.startup",
from cinder.image import image_utils
from cinder.openstack.common import fileutils
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import units
from cinder.volume import driver
try:
# check that configured directories are on GPFS
self._is_gpfs_path(directory)
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
msg = (_('%s is not on GPFS. Perhaps GPFS not mounted.') %
directory)
LOG.error(msg)
image_path = os.path.join(self.configuration.gpfs_images_dir, image_id)
try:
self._is_gpfs_path(image_path)
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
reason = 'image file not in GPFS'
return False, reason, None
cmd.append(path)
try:
self._execute(*cmd, run_as_root=True)
- except exception.ProcessExecutionError as exc:
+ except processutils.ProcessExecutionError as exc:
exception_message = (_("mkfs failed on volume %(vol)s, "
"error message was: %(err)s")
% {'vol': volume['name'], 'err': exc.stderr})
from cinder.image import image_utils
from cinder.openstack.common import fileutils
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import utils
from cinder.volume import driver
from cinder.volume import utils as volutils
if self.vg.get_volume(pool_name) is None:
try:
self.vg.create_thin_pool(pool_name)
- except exception.ProcessExecutionError as exc:
+ except processutils.ProcessExecutionError as exc:
exception_message = ("Failed to create thin pool, "
"error message was: %s"
% exc.stderr)
try:
(out, err) = self._execute('readlink', old_name)
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
link_path = '/dev/%s/%s' % (self.configuration.volume_group,
old_name)
LOG.debug(_('Symbolic link %s not found') % link_path)
from cinder import exception
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder.volume.drivers.netapp.api import NaApiError
from cinder.volume.drivers.netapp.api import NaElement
from cinder.volume.drivers.netapp.api import NaServer
try:
self._try_execute('ls', self._get_volume_path(nfs_mount,
volume_name))
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
# If the volume isn't present
return True
return False
try:
self._execute(*command, **kwargs)
return True
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
tries = tries + 1
if tries >= self.configuration.num_shell_tries:
raise
from cinder import exception
from cinder.image import image_utils
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import units
from cinder.volume import driver
"""
try:
self._execute(*cmd, run_as_root=True)
- except exception.ProcessExecutionError as exc:
+ except processutils.ProcessExecutionError as exc:
if ensure and 'already mounted' in exc.stderr:
LOG.warn(_("%s is already mounted"), share)
else:
from cinder import exception
from cinder.openstack.common import excutils
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import utils
from cinder.volume import volume_types
if exit_status != -1:
LOG.debug(_('Result was %s') % exit_status)
if check_exit_code and exit_status != 0:
- raise exception.ProcessExecutionError(exit_code=exit_status,
- stdout=stdout,
- stderr=stderr,
- cmd=cmd)
+ raise processutils.ProcessExecutionError(exit_code=exit_status,
+ stdout=stdout,
+ stderr=stderr,
+ cmd=cmd)
channel.close()
return (stdout, stderr)
from cinder import exception
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder.volume.drivers.san.san import SanISCSIDriver
cliq_args['prompt'] = 'false' # Don't confirm
try:
volume_info = self._cliq_get_volume_info(volume['name'])
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
LOG.error("Volume did not exist. It will not be deleted")
return
self._cliq_run_xml("deleteVolume", cliq_args)
last_exception = e
greenthread.sleep(random.randint(20, 500) / 100.0)
try:
- raise exception.ProcessExecutionError(
+ raise processutils.ProcessExecutionError(
exit_code=last_exception.exit_code,
stdout=last_exception.stdout,
stderr=last_exception.stderr,
cmd=last_exception.cmd)
except AttributeError:
- raise exception.ProcessExecutionError(
+ raise processutils.ProcessExecutionError(
exit_code=-1,
stdout="",
stderr="Error running SSH command",
from cinder import exception
from cinder.image import image_utils
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder import units
from cinder.volume import driver
raise exception.VolumeBackendAPIException(
data=exception_message)
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
exception_message = _("Sheepdog is not working")
raise exception.VolumeBackendAPIException(data=exception_message)
used = float(m.group(2))
stats['total_capacity_gb'] = total / (1024 ** 3)
stats['free_capacity_gb'] = (total - used) / (1024 ** 3)
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
LOG.exception(_('error refreshing volume stats'))
self._stats = stats
from cinder import exception
from cinder.openstack.common import excutils
from cinder.openstack.common import log as logging
+from cinder.openstack.common import processutils
from cinder.openstack.common import strutils
from cinder import utils
from cinder.volume.drivers.san import san
'license_compression_capacity') and value != '0':
self._compression_enabled = True
break
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
LOG.exception(_('Failed to get license information.'))
# Get the available I/O groups
def _call_prepare_fc_map(self, fc_map_id, source, target):
try:
out, err = self._run_ssh(['svctask', 'prestartfcmap', fc_map_id])
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
with excutils.save_and_reraise_exception():
LOG.error(_('_prepare_fc_map: Failed to prepare FlashCopy '
'from %(source)s to %(target)s.\n'
def _start_fc_map(self, fc_map_id, source, target):
try:
out, err = self._run_ssh(['svctask', 'startfcmap', fc_map_id])
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
with excutils.save_and_reraise_exception():
LOG.error(_('_start_fc_map: Failed to start FlashCopy '
'from %(source)s to %(target)s.\n'
try:
out, err = self._run_ssh(ssh_cmd)
- except exception.ProcessExecutionError as e:
+ except processutils.ProcessExecutionError as e:
# Didn't get details from the storage, return None
LOG.error(_('CLI Exception output:\n command: %(cmd)s\n '
'stdout: %(out)s\n stderr: %(err)s') %
from cinder.openstack.common import excutils
from cinder.openstack.common import log as logging
from cinder.openstack.common.notifier import api as notifier
+from cinder.openstack.common import processutils
from cinder.openstack.common import timeutils
from cinder.volume.flows import base
from cinder.volume import utils as volume_utils
'image_location': image_location})
try:
copy_image_to_volume(context, volume_ref, image_service, image_id)
- except exception.ProcessExecutionError as ex:
+ except processutils.ProcessExecutionError as ex:
LOG.error(_("Failed to copy image %(image_id)s to volume: "
"%(volume_id)s, error: %(error)s") %
{'volume_id': volume_id,
from cinder import exception
from cinder.openstack.common import log as logging
from cinder.openstack.common.notifier import api as notifier_api
+from cinder.openstack.common import processutils
from cinder.openstack.common import strutils
from cinder.openstack.common import timeutils
from cinder import units
try:
execute('dd', 'count=0', 'if=%s' % srcstr, 'of=%s' % deststr,
*extra_flags, run_as_root=True)
- except exception.ProcessExecutionError:
+ except processutils.ProcessExecutionError:
extra_flags = []
# If the volume is being unprovisioned then