diff --git a/cinder/tests/unit/volume/drivers/test_gpfs.py b/cinder/tests/unit/volume/drivers/test_gpfs.py index 67666c6ec15..efc146153aa 100644 --- a/cinder/tests/unit/volume/drivers/test_gpfs.py +++ b/cinder/tests/unit/volume/drivers/test_gpfs.py @@ -2050,7 +2050,7 @@ class GPFSRemoteDriverTestCase(test.TestCase): @mock.patch('paramiko.SSHClient', new=mock.MagicMock()) @mock.patch('os.path.isfile', return_value=True) - @mock.patch('six.moves.builtins.open') + @mock.patch('builtins.open') @mock.patch('os.path.expanduser') @mock.patch('paramiko.RSAKey.from_private_key_file') @mock.patch('oslo_concurrency.processutils.ssh_execute') @@ -2069,7 +2069,7 @@ class GPFSRemoteDriverTestCase(test.TestCase): @mock.patch('paramiko.SSHClient', new=mock.MagicMock()) @mock.patch('os.path.isfile', return_value=True) - @mock.patch('six.moves.builtins.open') + @mock.patch('builtins.open') @mock.patch('os.path.expanduser') @mock.patch('paramiko.RSAKey.from_private_key_file') @mock.patch('oslo_concurrency.processutils.ssh_execute') @@ -2088,7 +2088,7 @@ class GPFSRemoteDriverTestCase(test.TestCase): @mock.patch('paramiko.SSHClient', new=mock.MagicMock()) @mock.patch('os.path.isfile', return_value=True) - @mock.patch('six.moves.builtins.open') + @mock.patch('builtins.open') def test_get_active_gpfs_node_ip_missing_key_and_password(self, mock_open, mock_isfile): configuration = conf.Configuration(None) @@ -2100,7 +2100,7 @@ class GPFSRemoteDriverTestCase(test.TestCase): @mock.patch('paramiko.SSHClient', new=mock.MagicMock()) @mock.patch('os.path.isfile', return_value=True) - @mock.patch('six.moves.builtins.open') + @mock.patch('builtins.open') @mock.patch('os.path.expanduser') @mock.patch('paramiko.RSAKey.from_private_key_file') @mock.patch('oslo_concurrency.processutils.ssh_execute') @@ -2143,7 +2143,7 @@ class GPFSRemoteDriverTestCase(test.TestCase): @mock.patch('paramiko.SSHClient', new=mock.MagicMock()) @mock.patch('os.path.isfile', return_value=True) - @mock.patch('six.moves.builtins.open') + @mock.patch('builtins.open') @mock.patch('os.path.expanduser') @mock.patch('paramiko.RSAKey.from_private_key_file') @mock.patch('oslo_concurrency.processutils.ssh_execute') diff --git a/cinder/volume/drivers/ibm/gpfs.py b/cinder/volume/drivers/ibm/gpfs.py index 892e7ce384b..910772a7d38 100644 --- a/cinder/volume/drivers/ibm/gpfs.py +++ b/cinder/volume/drivers/ibm/gpfs.py @@ -26,7 +26,6 @@ from oslo_config import cfg from oslo_log import log as logging from oslo_utils import units import paramiko -import six from cinder.common import constants from cinder import context @@ -1148,7 +1147,7 @@ class GPFSDriver(driver.CloneableImageVD, except processutils.ProcessExecutionError as e: msg = (_('Failed to create consistency group: %(cgid)s. ' 'Error: %(excmsg)s.') % - {'cgid': group['id'], 'excmsg': six.text_type(e)}) + {'cgid': group['id'], 'excmsg': str(e)}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) @@ -1158,7 +1157,7 @@ class GPFSDriver(driver.CloneableImageVD, except processutils.ProcessExecutionError as e: msg = (_('Failed to link fileset for the share %(cgname)s. ' 'Error: %(excmsg)s.') % - {'cgname': cgname, 'excmsg': six.text_type(e)}) + {'cgname': cgname, 'excmsg': str(e)}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) @@ -1168,7 +1167,7 @@ class GPFSDriver(driver.CloneableImageVD, msg = (_('Failed to set permissions for the consistency group ' '%(cgname)s. ' 'Error: %(excmsg)s.') % - {'cgname': cgname, 'excmsg': six.text_type(e)}) + {'cgname': cgname, 'excmsg': str(e)}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) @@ -1203,7 +1202,7 @@ class GPFSDriver(driver.CloneableImageVD, except processutils.ProcessExecutionError as e: msg = (_('Failed to unlink fileset for consistency group ' '%(cgname)s. Error: %(excmsg)s.') % - {'cgname': cgname, 'excmsg': six.text_type(e)}) + {'cgname': cgname, 'excmsg': str(e)}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) @@ -1213,7 +1212,7 @@ class GPFSDriver(driver.CloneableImageVD, except processutils.ProcessExecutionError as e: msg = (_('Failed to delete fileset for consistency group ' '%(cgname)s. Error: %(excmsg)s.') % - {'cgname': cgname, 'excmsg': six.text_type(e)}) + {'cgname': cgname, 'excmsg': str(e)}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg)