From: John Griffith Date: Mon, 10 Jun 2013 21:05:33 +0000 (-0600) Subject: Remove direct call to utils.execute. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b8f4d7f1e9793a4993b7504bd5e864b4ed9646db;p=openstack-build%2Fcinder-build.git Remove direct call to utils.execute. The executes calls in the base driver class are set up to use the exectue enginge passed in on init. There are a couple of methods that call utils.execute directly, and as a result you end up not using the expected execute engine when you pass in something other than default for these two calls. We'd like to get away from the local execute altogether and use the OpenStack common version only, so fix these in driver.py and put the appropriate wrapper around them. Change-Id: Ibc17c9c2a0c8f27b4533ed86377a66ce668aeab5 --- diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 269622721..a6b445571 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -312,7 +312,7 @@ class ISCSIDriver(VolumeDriver): def _run_iscsiadm_bare(self, iscsi_command, **kwargs): check_exit_code = kwargs.pop('check_exit_code', 0) - (out, err) = utils.execute('iscsiadm', + (out, err) = self._execute('iscsiadm', *iscsi_command, run_as_root=True, check_exit_code=check_exit_code) @@ -362,7 +362,7 @@ class ISCSIDriver(VolumeDriver): 'of=/dev/null', 'count=1') out, info = None, None try: - out, info = utils.execute(*cmd, run_as_root=True) + out, info = self._execute(*cmd, run_as_root=True) except exception.ProcessExecutionError as e: LOG.error(_("Failed to access the device on the path " "%(path)s: %(error)s.") %