Dropping explicit unicode literal
In python 3, all strings are considered as unicode string. This patch drops the explicit unicode literal (u'...') or (u"..") appearances from the unicode strings. Change-Id: I5c4b0eb24ecade37c22e7777640466116a893a89
This commit is contained in:
parent
a66f688992
commit
f89d1b7b80
|
@ -1917,7 +1917,7 @@ class BackupsAPITestCase(test.TestCase):
|
||||||
self.assertEqual(backup.id, res_dict['restore']['backup_id'])
|
self.assertEqual(backup.id, res_dict['restore']['backup_id'])
|
||||||
self.assertEqual(volume.id, res_dict['restore']['volume_id'])
|
self.assertEqual(volume.id, res_dict['restore']['volume_id'])
|
||||||
self.assertEqual(volume_name, res_dict['restore']['volume_name'])
|
self.assertEqual(volume_name, res_dict['restore']['volume_name'])
|
||||||
mock_restore_backup.assert_called_once_with(mock.ANY, u'testhost',
|
mock_restore_backup.assert_called_once_with(mock.ANY, 'testhost',
|
||||||
mock.ANY, volume.id)
|
mock.ANY, volume.id)
|
||||||
# Manually check if restore_backup was called with appropriate backup.
|
# Manually check if restore_backup was called with appropriate backup.
|
||||||
self.assertEqual(backup.id, mock_restore_backup.call_args[0][2].id)
|
self.assertEqual(backup.id, mock_restore_backup.call_args[0][2].id)
|
||||||
|
|
|
@ -687,7 +687,7 @@ class ServicesTest(test.TestCase):
|
||||||
fakes.HTTPRequest.blank('v1/fake/os-services/disable-log-reason'))
|
fakes.HTTPRequest.blank('v1/fake/os-services/disable-log-reason'))
|
||||||
body = {'host': 'host1',
|
body = {'host': 'host1',
|
||||||
'binary': 'cinder-scheduler',
|
'binary': 'cinder-scheduler',
|
||||||
'disabled_reason': u'test-reason',
|
'disabled_reason': 'test-reason',
|
||||||
}
|
}
|
||||||
res_dict = self.controller.update(req, "disable-log-reason", body)
|
res_dict = self.controller.update(req, "disable-log-reason", body)
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ class SnapshotManageTest(test.TestCase):
|
||||||
# correct arguments.
|
# correct arguments.
|
||||||
self.assertEqual(1, mock_rpcapi.call_count)
|
self.assertEqual(1, mock_rpcapi.call_count)
|
||||||
args = mock_rpcapi.call_args[0]
|
args = mock_rpcapi.call_args[0]
|
||||||
self.assertEqual({u'fake_key': u'fake_ref'}, args[3])
|
self.assertEqual({'fake_key': 'fake_ref'}, args[3])
|
||||||
|
|
||||||
@mock.patch(
|
@mock.patch(
|
||||||
'cinder.scheduler.rpcapi.SchedulerAPI.manage_existing_snapshot')
|
'cinder.scheduler.rpcapi.SchedulerAPI.manage_existing_snapshot')
|
||||||
|
|
|
@ -191,8 +191,8 @@ class VolumeTypesManageApiTest(test.TestCase):
|
||||||
mock_get.return_value = \
|
mock_get.return_value = \
|
||||||
{'extra_specs': {"key1": "value1"},
|
{'extra_specs': {"key1": "value1"},
|
||||||
'id': DEFAULT_VOLUME_TYPE,
|
'id': DEFAULT_VOLUME_TYPE,
|
||||||
'name': u'vol_type_1',
|
'name': 'vol_type_1',
|
||||||
'description': u'vol_type_desc_%s' % DEFAULT_VOLUME_TYPE}
|
'description': 'vol_type_desc_%s' % DEFAULT_VOLUME_TYPE}
|
||||||
mock_destroy.side_effect = return_volume_types_destroy
|
mock_destroy.side_effect = return_volume_types_destroy
|
||||||
|
|
||||||
req = fakes.HTTPRequest.blank('/v2/%s/types/%s' %
|
req = fakes.HTTPRequest.blank('/v2/%s/types/%s' %
|
||||||
|
@ -235,8 +235,8 @@ class VolumeTypesManageApiTest(test.TestCase):
|
||||||
mock_get_volume_type_by_name.return_value = \
|
mock_get_volume_type_by_name.return_value = \
|
||||||
{'extra_specs': {"key1": "value1"},
|
{'extra_specs': {"key1": "value1"},
|
||||||
'id': DEFAULT_VOLUME_TYPE,
|
'id': DEFAULT_VOLUME_TYPE,
|
||||||
'name': u'vol_type_1',
|
'name': 'vol_type_1',
|
||||||
'description': u''}
|
'description': ''}
|
||||||
|
|
||||||
type_description = ""
|
type_description = ""
|
||||||
body = {"volume_type": {"name": "vol_type_1",
|
body = {"volume_type": {"name": "vol_type_1",
|
||||||
|
@ -338,8 +338,8 @@ class VolumeTypesManageApiTest(test.TestCase):
|
||||||
mock_get_volume_type_by_name.return_value = \
|
mock_get_volume_type_by_name.return_value = \
|
||||||
{'extra_specs': {"key1": "value1"},
|
{'extra_specs': {"key1": "value1"},
|
||||||
'id': DEFAULT_VOLUME_TYPE,
|
'id': DEFAULT_VOLUME_TYPE,
|
||||||
'name': u'vol_type_1',
|
'name': 'vol_type_1',
|
||||||
'description': u'vol_type_desc_1'}
|
'description': 'vol_type_desc_1'}
|
||||||
|
|
||||||
body = {"volume_type": {"name": "vol_type_1",
|
body = {"volume_type": {"name": "vol_type_1",
|
||||||
"os-volume-type-access:is_public": True,
|
"os-volume-type-access:is_public": True,
|
||||||
|
@ -424,8 +424,8 @@ class VolumeTypesManageApiTest(test.TestCase):
|
||||||
self, mock_get_volume_type, mock_type_update):
|
self, mock_get_volume_type, mock_type_update):
|
||||||
|
|
||||||
mock_get_volume_type.return_value = \
|
mock_get_volume_type.return_value = \
|
||||||
{'id': DEFAULT_VOLUME_TYPE, 'name': u'vol_type_1',
|
{'id': DEFAULT_VOLUME_TYPE, 'name': 'vol_type_1',
|
||||||
'description': u''}
|
'description': ''}
|
||||||
|
|
||||||
type_description = ""
|
type_description = ""
|
||||||
body = {"volume_type": {"description": type_description}}
|
body = {"volume_type": {"description": type_description}}
|
||||||
|
|
|
@ -818,30 +818,30 @@ class VolumeImageActionsTest(test.TestCase):
|
||||||
|
|
||||||
def fake_image_service_create(self, *args):
|
def fake_image_service_create(self, *args):
|
||||||
ret = {
|
ret = {
|
||||||
'status': u'queued',
|
'status': 'queued',
|
||||||
'name': u'image_name',
|
'name': 'image_name',
|
||||||
'deleted': False,
|
'deleted': False,
|
||||||
'container_format': u'bare',
|
'container_format': 'bare',
|
||||||
'created_at': datetime.datetime(1, 1, 1, 1, 1, 1),
|
'created_at': datetime.datetime(1, 1, 1, 1, 1, 1),
|
||||||
'disk_format': u'raw',
|
'disk_format': 'raw',
|
||||||
'updated_at': datetime.datetime(1, 1, 1, 1, 1, 1),
|
'updated_at': datetime.datetime(1, 1, 1, 1, 1, 1),
|
||||||
'id': fake.IMAGE_ID,
|
'id': fake.IMAGE_ID,
|
||||||
'min_ram': 0,
|
'min_ram': 0,
|
||||||
'checksum': None,
|
'checksum': None,
|
||||||
'min_disk': 0,
|
'min_disk': 0,
|
||||||
'deleted_at': None,
|
'deleted_at': None,
|
||||||
'properties': {u'x_billing_code_license': u'246254365'},
|
'properties': {'x_billing_code_license': '246254365'},
|
||||||
'size': 0}
|
'size': 0}
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def fake_image_service_create_with_params(self, *args):
|
def fake_image_service_create_with_params(self, *args):
|
||||||
ret = {
|
ret = {
|
||||||
'status': u'queued',
|
'status': 'queued',
|
||||||
'name': u'image_name',
|
'name': 'image_name',
|
||||||
'deleted': False,
|
'deleted': False,
|
||||||
'container_format': u'bare',
|
'container_format': 'bare',
|
||||||
'created_at': datetime.datetime(1, 1, 1, 1, 1, 1),
|
'created_at': datetime.datetime(1, 1, 1, 1, 1, 1),
|
||||||
'disk_format': u'raw',
|
'disk_format': 'raw',
|
||||||
'updated_at': datetime.datetime(1, 1, 1, 1, 1, 1),
|
'updated_at': datetime.datetime(1, 1, 1, 1, 1, 1),
|
||||||
'id': fake.IMAGE_ID,
|
'id': fake.IMAGE_ID,
|
||||||
'min_ram': 0,
|
'min_ram': 0,
|
||||||
|
@ -850,7 +850,7 @@ class VolumeImageActionsTest(test.TestCase):
|
||||||
'visibility': 'public',
|
'visibility': 'public',
|
||||||
'protected': True,
|
'protected': True,
|
||||||
'deleted_at': None,
|
'deleted_at': None,
|
||||||
'properties': {u'x_billing_code_license': u'246254365'},
|
'properties': {'x_billing_code_license': '246254365'},
|
||||||
'size': 0}
|
'size': 0}
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ from cinder.tests.unit import test
|
||||||
def generate_type(type_id, is_public):
|
def generate_type(type_id, is_public):
|
||||||
return {
|
return {
|
||||||
'id': type_id,
|
'id': type_id,
|
||||||
'name': u'test',
|
'name': 'test',
|
||||||
'deleted': False,
|
'deleted': False,
|
||||||
'created_at': datetime.datetime(2012, 1, 1, 1, 1, 1, 1),
|
'created_at': datetime.datetime(2012, 1, 1, 1, 1, 1, 1),
|
||||||
'updated_at': None,
|
'updated_at': None,
|
||||||
|
|
|
@ -243,7 +243,7 @@ class ClustersTestCase(test.TestCase):
|
||||||
return_value=CLUSTERS_ORM[1])
|
return_value=CLUSTERS_ORM[1])
|
||||||
def test_update_enable(self, get_mock, update_mock):
|
def test_update_enable(self, get_mock, update_mock):
|
||||||
req = FakeRequest()
|
req = FakeRequest()
|
||||||
expected = {'cluster': {'name': u'cluster2',
|
expected = {'cluster': {'name': 'cluster2',
|
||||||
'binary': 'cinder-volume',
|
'binary': 'cinder-volume',
|
||||||
'state': 'down',
|
'state': 'down',
|
||||||
'status': 'enabled',
|
'status': 'enabled',
|
||||||
|
@ -266,7 +266,7 @@ class ClustersTestCase(test.TestCase):
|
||||||
def test_update_disable(self, get_mock, update_mock):
|
def test_update_disable(self, get_mock, update_mock):
|
||||||
req = FakeRequest()
|
req = FakeRequest()
|
||||||
disabled_reason = 'For testing'
|
disabled_reason = 'For testing'
|
||||||
expected = {'cluster': {'name': u'cluster_name',
|
expected = {'cluster': {'name': 'cluster_name',
|
||||||
'state': 'up',
|
'state': 'up',
|
||||||
'binary': 'cinder-volume',
|
'binary': 'cinder-volume',
|
||||||
'status': 'disabled',
|
'status': 'disabled',
|
||||||
|
|
|
@ -89,7 +89,7 @@ openstackdocs_repo_name = 'openstack/cinder'
|
||||||
openstackdocs_bug_project = 'cinder'
|
openstackdocs_bug_project = 'cinder'
|
||||||
openstackdocs_bug_tag = 'doc'
|
openstackdocs_bug_tag = 'doc'
|
||||||
openstackdocs_pdf_link = True
|
openstackdocs_pdf_link = True
|
||||||
copyright = u'2010-present, OpenStack Foundation'
|
copyright = '2010-present, OpenStack Foundation'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
@ -129,13 +129,13 @@ modindex_common_prefix = ['cinder.']
|
||||||
# -- Options for man page output ----------------------------------------------
|
# -- Options for man page output ----------------------------------------------
|
||||||
|
|
||||||
# Grouping the document tree for man pages.
|
# Grouping the document tree for man pages.
|
||||||
# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual'
|
# List of tuples 'sourcefile', 'target', 'title', 'Authors name', 'manual'
|
||||||
|
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('cli/cinder-manage', 'cinder-manage', u'Cloud controller fabric',
|
('cli/cinder-manage', 'cinder-manage', 'Cloud controller fabric',
|
||||||
[u'OpenStack'], 1),
|
['OpenStack'], 1),
|
||||||
('cli/cinder-status', 'cinder-status', u'Upgrade checking utility',
|
('cli/cinder-status', 'cinder-status', 'Upgrade checking utility',
|
||||||
[u'OpenStack'], 1),
|
['OpenStack'], 1),
|
||||||
]
|
]
|
||||||
|
|
||||||
# -- Options for HTML output --------------------------------------------------
|
# -- Options for HTML output --------------------------------------------------
|
||||||
|
@ -228,8 +228,8 @@ htmlhelp_basename = 'cinderdoc'
|
||||||
# (source start file, target name, title, author, documentclass
|
# (source start file, target name, title, author, documentclass
|
||||||
# [howto/manual]).
|
# [howto/manual]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'doc-cinder.tex', u'Cinder Documentation',
|
('index', 'doc-cinder.tex', 'Cinder Documentation',
|
||||||
u'Cinder Contributors', 'manual'),
|
'Cinder Contributors', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
|
|
Loading…
Reference in New Issue