summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlikui <likui@yovole.com>2021-01-03 16:42:29 +0800
committerlikui <likui@yovole.com>2021-01-03 16:42:47 +0800
commit5d641033d40ac53fdae7c12b070a9c54dac6a49c (patch)
tree70035996c35d877662cb2371a9d411ffabe6ff94
parentbcb8992f995468fddfc1da472f74f346b7acd7f4 (diff)
downloadtrove-5d641033d40ac53fdae7c12b070a9c54dac6a49c.tar.gz
remove unicode from code
Implements: blueprint remove-unicode Change-Id: Ib7eb517f404fe87b880f7091366721d2cfc5cdf8
-rwxr-xr-xapi-ref/source/conf.py10
-rw-r--r--doc/source/conf.py24
-rw-r--r--releasenotes/source/conf.py16
-rw-r--r--trove/common/strategies/cluster/experimental/mongodb/api.py4
-rw-r--r--trove/tests/fakes/swift.py32
-rw-r--r--trove/tests/unittests/backup/test_backup_models.py4
-rw-r--r--trove/tests/unittests/common/test_auth.py2
-rw-r--r--trove/tests/unittests/common/test_crypto_utils.py6
-rw-r--r--trove/tests/unittests/common/test_utils.py8
9 files changed, 53 insertions, 53 deletions
diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py
index 19e35cfc..d0702e23 100755
--- a/api-ref/source/conf.py
+++ b/api-ref/source/conf.py
@@ -64,8 +64,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
-project = u'Database API Reference'
-copyright = u'2010-present, OpenStack Foundation'
+project = 'Database API Reference'
+copyright = '2010-present, OpenStack Foundation'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -99,7 +99,7 @@ pygments_style = 'native'
# -- Options for man page output ----------------------------------------------
# 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'
# -- Options for HTML output --------------------------------------------------
@@ -185,8 +185,8 @@ htmlhelp_basename = 'trovedoc'
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
- ('index', 'Trove.tex', u'OpenStack Database API Documentation',
- u'OpenStack Foundation', 'manual'),
+ ('index', 'Trove.tex', 'OpenStack Database API Documentation',
+ 'OpenStack Foundation', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 7f7fa9a4..fbbd02cc 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -38,8 +38,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
-project = u'Trove'
-copyright = u'2013, OpenStack Foundation'
+project = 'Trove'
+copyright = '2013, OpenStack Foundation'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -164,8 +164,8 @@ latex_documents = [
(
'index',
'%s.tex' % project,
- u'%s Documentation' % project,
- u'OpenStack Foundation',
+ '%s Documentation' % project,
+ 'OpenStack Foundation',
'manual'
),
]
@@ -199,8 +199,8 @@ latex_documents = [
# (
# 'index',
# '%s' % project,
-# u'%s Documentation' % project,
-# u'OpenStack Foundation',
+# '%s Documentation' % project,
+# 'OpenStack Foundation',
# 1
# ),
# ]
@@ -218,8 +218,8 @@ texinfo_documents = [
(
'index',
'%s' % project,
- u'%s Documentation' % project,
- u'OpenStack Foundation',
+ '%s Documentation' % project,
+ 'OpenStack Foundation',
'%s' % project,
'Database as a service.',
'Miscellaneous'
@@ -243,10 +243,10 @@ texinfo_documents = [
# -- Options for Epub output --------------------------------------------------
# Bibliographic Dublin Core info.
-epub_title = u'%s' % project
-epub_author = u'OpenStack Foundation'
-epub_publisher = u'OpenStack Foundation'
-epub_copyright = u'2013, OpenStack Foundation'
+epub_title = '%s' % project
+epub_author = 'OpenStack Foundation'
+epub_publisher = 'OpenStack Foundation'
+epub_copyright = '2013, OpenStack Foundation'
# The language of the text. It defaults to the language option
# or en if the language is not set.
diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py
index 25398e44..055537e2 100644
--- a/releasenotes/source/conf.py
+++ b/releasenotes/source/conf.py
@@ -62,8 +62,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
-project = u'Trove Release Notes'
-copyright = u'2015, Trove Developers'
+project = 'Trove Release Notes'
+copyright = '2015, Trove Developers'
# Release notes are version independent.
# The short X.Y version.
@@ -214,8 +214,8 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- ('index', 'TroveReleaseNotes.tex', u'Trove Release Notes Documentation',
- u'Trove Developers', 'manual'),
+ ('index', 'TroveReleaseNotes.tex', 'Trove Release Notes Documentation',
+ 'Trove Developers', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -244,8 +244,8 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'trovereleasenotes', u'Trove Release Notes Documentation',
- [u'Trove Developers'], 1)
+ ('index', 'trovereleasenotes', 'Trove Release Notes Documentation',
+ ['Trove Developers'], 1)
]
# If true, show URL addresses after external links.
@@ -258,8 +258,8 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- ('index', 'TroveReleaseNotes', u'Trove Release Notes Documentation',
- u'Trove Developers', 'TroveReleaseNotes',
+ ('index', 'TroveReleaseNotes', 'Trove Release Notes Documentation',
+ 'Trove Developers', 'TroveReleaseNotes',
'One line description of project.',
'Miscellaneous'),
]
diff --git a/trove/common/strategies/cluster/experimental/mongodb/api.py b/trove/common/strategies/cluster/experimental/mongodb/api.py
index a78feea4..66413fa5 100644
--- a/trove/common/strategies/cluster/experimental/mongodb/api.py
+++ b/trove/common/strategies/cluster/experimental/mongodb/api.py
@@ -224,8 +224,8 @@ class MongoDbCluster(models.Cluster):
required=True))
volume_size = int(_check_option('volume', required=True)['size'])
instance_type = _check_option('type', required=True,
- valid_values=[u'replica',
- u'query_router'])
+ valid_values=['replica',
+ 'query_router'])
name = _check_option('name')
related_to = _check_option('related_to')
nics = _check_option('nics')
diff --git a/trove/tests/fakes/swift.py b/trove/tests/fakes/swift.py
index bd2da58e..a0a70486 100644
--- a/trove/tests/fakes/swift.py
+++ b/trove/tests/fakes/swift.py
@@ -55,14 +55,14 @@ class FakeSwiftConnection(object):
def get_auth(self):
return (
- u"http://127.0.0.1:8080/v1/AUTH_c7b038976df24d96bf1980f5da17bd89",
- u'MIINrwYJKoZIhvcNAQcCoIINoDCCDZwCAQExCTAHBgUrDgMCGjCCDIgGCSqGSIb3'
- u'DQEHAaCCDHkEggx1eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAi'
- u'MjAxMy0wMy0xOFQxODoxMzoyMC41OTMyNzYiLCAiZXhwaXJlcyI6ICIyMDEzLTAz'
- u'LTE5VDE4OjEzOjIwWiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7'
- u'ImVuYWJsZWQiOiB0cnVlLCAiZGVzY3JpcHRpb24iOiBudWxsLCAibmFtZSI6ICJy'
- u'ZWRkd2FyZiIsICJpZCI6ICJjN2IwMzg5NzZkZjI0ZDk2YmYxOTgwZjVkYTE3YmQ4'
- u'OSJ9fSwgInNlcnZpY2VDYXRhbG9nIjogW3siZW5kcG9pbnRzIjogW3siYWRtaW5')
+ "http://127.0.0.1:8080/v1/AUTH_c7b038976df24d96bf1980f5da17bd89",
+ 'MIINrwYJKoZIhvcNAQcCoIINoDCCDZwCAQExCTAHBgUrDgMCGjCCDIgGCSqGSIb3'
+ 'DQEHAaCCDHkEggx1eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAi'
+ 'MjAxMy0wMy0xOFQxODoxMzoyMC41OTMyNzYiLCAiZXhwaXJlcyI6ICIyMDEzLTAz'
+ 'LTE5VDE4OjEzOjIwWiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7'
+ 'ImVuYWJsZWQiOiB0cnVlLCAiZGVzY3JpcHRpb24iOiBudWxsLCAibmFtZSI6ICJy'
+ 'ZWRkd2FyZiIsICJpZCI6ICJjN2IwMzg5NzZkZjI0ZDk2YmYxOTgwZjVkYTE3YmQ4'
+ 'OSJ9fSwgInNlcnZpY2VDYXRhbG9nIjogW3siZW5kcG9pbnRzIjogW3siYWRtaW5')
def get_account(self):
return ({'content-length': '2', 'accept-ranges': 'bytes',
@@ -337,14 +337,14 @@ class SwiftClientStub(Patcher):
'x-account-object-count': '0'}, self._containers_list)
get_auth_return_value = (
- u"http://127.0.0.1:8080/v1/AUTH_c7b038976df24d96bf1980f5da17bd89",
- u'MIINrwYJKoZIhvcNAQcCoIINoDCCDZwCAQExCTAHBgUrDgMCGjCCDIgGCSqGSIb3'
- u'DQEHAaCCDHkEggx1eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAi'
- u'MjAxMy0wMy0xOFQxODoxMzoyMC41OTMyNzYiLCAiZXhwaXJlcyI6ICIyMDEzLTAz'
- u'LTE5VDE4OjEzOjIwWiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7'
- u'ImVuYWJsZWQiOiB0cnVlLCAiZGVzY3JpcHRpb24iOiBudWxsLCAibmFtZSI6ICJy'
- u'ZWRkd2FyZiIsICJpZCI6ICJjN2IwMzg5NzZkZjI0ZDk2YmYxOTgwZjVkYTE3YmQ4'
- u'OSJ9fSwgInNlcnZpY2VDYXRhbG9nIjogW3siZW5kcG9pbnRzIjogW3siYWRtaW5')
+ "http://127.0.0.1:8080/v1/AUTH_c7b038976df24d96bf1980f5da17bd89",
+ 'MIINrwYJKoZIhvcNAQcCoIINoDCCDZwCAQExCTAHBgUrDgMCGjCCDIgGCSqGSIb3'
+ 'DQEHAaCCDHkEggx1eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAi'
+ 'MjAxMy0wMy0xOFQxODoxMzoyMC41OTMyNzYiLCAiZXhwaXJlcyI6ICIyMDEzLTAz'
+ 'LTE5VDE4OjEzOjIwWiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7'
+ 'ImVuYWJsZWQiOiB0cnVlLCAiZGVzY3JpcHRpb24iOiBudWxsLCAibmFtZSI6ICJy'
+ 'ZWRkd2FyZiIsICJpZCI6ICJjN2IwMzg5NzZkZjI0ZDk2YmYxOTgwZjVkYTE3YmQ4'
+ 'OSJ9fSwgInNlcnZpY2VDYXRhbG9nIjogW3siZW5kcG9pbnRzIjogW3siYWRtaW5')
get_auth_patcher = patch.object(
swift_client.Connection, 'get_auth',
diff --git a/trove/tests/unittests/backup/test_backup_models.py b/trove/tests/unittests/backup/test_backup_models.py
index 7ff6066c..2f97b451 100644
--- a/trove/tests/unittests/backup/test_backup_models.py
+++ b/trove/tests/unittests/backup/test_backup_models.py
@@ -547,7 +547,7 @@ class OrderingTests(trove_testtools.TestCase):
backups, marker = models.Backup.list(self.context)
self.assertIsNone(marker)
actual = [b.name for b in backups]
- expected = [u'one', u'two', u'three', u'four']
+ expected = ['one', 'two', 'three', 'four']
self.assertEqual(expected, actual)
def test_list_for_instance(self):
@@ -555,7 +555,7 @@ class OrderingTests(trove_testtools.TestCase):
self.instance_id)
self.assertIsNone(marker)
actual = [b.name for b in backups]
- expected = [u'one', u'two', u'three', u'four']
+ expected = ['one', 'two', 'three', 'four']
self.assertEqual(expected, actual)
diff --git a/trove/tests/unittests/common/test_auth.py b/trove/tests/unittests/common/test_auth.py
index 68772719..1b4086d1 100644
--- a/trove/tests/unittests/common/test_auth.py
+++ b/trove/tests/unittests/common/test_auth.py
@@ -26,7 +26,7 @@ class TestAuth(trove_testtools.TestCase):
req = webob.Request.blank(url)
# test string with chinese characters
- test_str = u'\u6d4b\u8bd5'
+ test_str = '\u6d4b\u8bd5'
req.headers = {
'X-Tenant-ID': tenant_id,
'X-Auth-Project-Id': test_str
diff --git a/trove/tests/unittests/common/test_crypto_utils.py b/trove/tests/unittests/common/test_crypto_utils.py
index 28810ce4..fa469035 100644
--- a/trove/tests/unittests/common/test_crypto_utils.py
+++ b/trove/tests/unittests/common/test_crypto_utils.py
@@ -33,7 +33,7 @@ class TestEncryptUtils(trove_testtools.TestCase):
def test_encode_decode_string(self):
random_data = bytearray(os.urandom(12))
data = [b'abc', b'numbers01234', b'\x00\xFF\x00\xFF\xFF\x00',
- random_data, u'Unicode:\u20ac']
+ random_data, 'Unicode:\u20ac']
for datum in data:
encoded_data = crypto_utils.encode_data(datum)
@@ -81,7 +81,7 @@ class TestEncryptUtils(trove_testtools.TestCase):
'P/RRPT'),
# Unicoded string (encoded to UTF-8)
- (u'Unicode:\u20ac',
+ ('Unicode:\u20ac',
'eHh4eHh4eHh4eHh4eHh4eAMsI5YsrtMNAPJfVF0j9NegXML7OsJ0LuAy66'
'LKv5F4'),
):
@@ -99,7 +99,7 @@ class TestEncryptUtils(trove_testtools.TestCase):
'KNN0NH',
b'Hello World!'),
- # Unicoded string: u'Unicode:\u20ac'
+ # Unicoded string: 'Unicode:\u20ac'
('ZUhoNGVIaDRlSGg0ZUhoNIHZLIuIcQCRwWY7PR2y7JcqoDf4ViqXIfh0uE'
'Rbg9BA',
b'Unicode:\xe2\x82\xac'),
diff --git a/trove/tests/unittests/common/test_utils.py b/trove/tests/unittests/common/test_utils.py
index c81cd679..4f31d08b 100644
--- a/trove/tests/unittests/common/test_utils.py
+++ b/trove/tests/unittests/common/test_utils.py
@@ -177,12 +177,12 @@ class TestUtils(trove_testtools.TestCase):
def test_req_to_text(self):
req = webob.Request.blank('/')
- expected = u'GET / HTTP/1.0\r\nHost: localhost:80'
+ expected = 'GET / HTTP/1.0\r\nHost: localhost:80'
self.assertEqual(expected, utils.req_to_text(req))
# add a header containing unicode characters
req.headers.update({
- 'X-Auth-Project-Id': u'\u6d4b\u8bd5'})
- expected = (u'GET / HTTP/1.0\r\nHost: localhost:80\r\n'
- u'X-Auth-Project-Id: \u6d4b\u8bd5')
+ 'X-Auth-Project-Id': '\u6d4b\u8bd5'})
+ expected = ('GET / HTTP/1.0\r\nHost: localhost:80\r\n'
+ 'X-Auth-Project-Id: \u6d4b\u8bd5')
self.assertEqual(expected, utils.req_to_text(req))