Merge "Remove six from GPFS driver"

This commit is contained in:
Zuul 2023-05-19 15:50:57 +00:00 committed by Gerrit Code Review
commit 7bca35c935
2 changed files with 10 additions and 11 deletions

View File

@ -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')

View File

@ -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)