From 6d98ead918887908a7d42cee11ee481979beaccb Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Thu, 21 Jul 2022 17:31:02 -0400 Subject: [PATCH] Tests: Quobyte: Remove six usage Remove "six" usage from this test module. Change-Id: Id9f3864c21d404fb5d488edfd983f7cbad6a276d --- cinder/tests/unit/volume/drivers/test_quobyte.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cinder/tests/unit/volume/drivers/test_quobyte.py b/cinder/tests/unit/volume/drivers/test_quobyte.py index 94b82e8c269..05d606f9009 100644 --- a/cinder/tests/unit/volume/drivers/test_quobyte.py +++ b/cinder/tests/unit/volume/drivers/test_quobyte.py @@ -16,6 +16,7 @@ """Unit tests for the Quobyte driver module.""" import errno +from io import StringIO import os import shutil import traceback @@ -27,7 +28,6 @@ from oslo_utils import fileutils from oslo_utils import imageutils from oslo_utils import units import psutil -import six from cinder import context from cinder import db @@ -121,7 +121,7 @@ class QuobyteDriverTestCase(test.TestCase): self.assertIsInstance(exc, excClass, 'Wrong exception caught: %s Stacktrace: %s' % (exc, traceback.format_exc())) - self.assertIn(msg, six.text_type(exc)) + self.assertIn(msg, str(exc)) if not caught: self.fail('Expected raised exception but nothing caught.') @@ -375,7 +375,7 @@ class QuobyteDriverTestCase(test.TestCase): mock.patch('cinder.volume.drivers.quobyte.QuobyteDriver' '._validate_volume') as mock_validate: # Content of /proc/mount (not mounted yet). - mock_open.return_value = six.StringIO( + mock_open.return_value = StringIO( "/dev/sda5 / ext4 rw,relatime,data=ordered 0 0") self._driver._mount_quobyte(self.TEST_QUOBYTE_VOLUME, @@ -396,7 +396,7 @@ class QuobyteDriverTestCase(test.TestCase): mock.patch('cinder.volume.drivers.quobyte.QuobyteDriver' '._validate_volume') as mock_validate: # Content of /proc/mount (already mounted). - mock_open.return_value = six.StringIO( + mock_open.return_value = StringIO( "quobyte@%s %s fuse rw,nosuid,nodev,noatime,user_id=1000" ",group_id=100,default_permissions,allow_other 0 0" % (self.TEST_QUOBYTE_VOLUME, self.TEST_MNT_POINT)) @@ -423,7 +423,7 @@ class QuobyteDriverTestCase(test.TestCase): mock.patch('cinder.volume.drivers.quobyte.QuobyteDriver' '._validate_volume') as mock_validate: # Content of /proc/mount (empty). - mock_open.return_value = six.StringIO() + mock_open.return_value = StringIO() mock_execute.side_effect = [None, putils.ProcessExecutionError( stderr='is busy or already mounted')] @@ -452,7 +452,7 @@ class QuobyteDriverTestCase(test.TestCase): mock.patch('oslo_utils.fileutils.ensure_tree') as mock_mkdir, \ mock.patch('cinder.volume.drivers.quobyte.QuobyteDriver' '.read_proc_mount') as mock_open: - mock_open.return_value = six.StringIO() + mock_open.return_value = StringIO() mock_execute.side_effect = [ None, # mkdir putils.ProcessExecutionError( # mount