remove unicode from code
Implements: blueprint remove-unicode Change-Id: Ib7eb517f404fe87b880f7091366721d2cfc5cdf8
This commit is contained in:
parent
bcb8992f99
commit
5d641033d4
@ -64,8 +64,8 @@ source_suffix = '.rst'
|
|||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'Database API Reference'
|
project = 'Database API Reference'
|
||||||
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.
|
||||||
@ -99,7 +99,7 @@ pygments_style = 'native'
|
|||||||
# -- 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'
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output --------------------------------------------------
|
# -- Options for HTML output --------------------------------------------------
|
||||||
@ -185,8 +185,8 @@ htmlhelp_basename = 'trovedoc'
|
|||||||
# (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', 'Trove.tex', u'OpenStack Database API Documentation',
|
('index', 'Trove.tex', 'OpenStack Database API Documentation',
|
||||||
u'OpenStack Foundation', 'manual'),
|
'OpenStack Foundation', '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
|
||||||
|
@ -38,8 +38,8 @@ source_suffix = '.rst'
|
|||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'Trove'
|
project = 'Trove'
|
||||||
copyright = u'2013, OpenStack Foundation'
|
copyright = '2013, 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.
|
||||||
@ -164,8 +164,8 @@ latex_documents = [
|
|||||||
(
|
(
|
||||||
'index',
|
'index',
|
||||||
'%s.tex' % project,
|
'%s.tex' % project,
|
||||||
u'%s Documentation' % project,
|
'%s Documentation' % project,
|
||||||
u'OpenStack Foundation',
|
'OpenStack Foundation',
|
||||||
'manual'
|
'manual'
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
@ -199,8 +199,8 @@ latex_documents = [
|
|||||||
# (
|
# (
|
||||||
# 'index',
|
# 'index',
|
||||||
# '%s' % project,
|
# '%s' % project,
|
||||||
# u'%s Documentation' % project,
|
# '%s Documentation' % project,
|
||||||
# u'OpenStack Foundation',
|
# 'OpenStack Foundation',
|
||||||
# 1
|
# 1
|
||||||
# ),
|
# ),
|
||||||
# ]
|
# ]
|
||||||
@ -218,8 +218,8 @@ texinfo_documents = [
|
|||||||
(
|
(
|
||||||
'index',
|
'index',
|
||||||
'%s' % project,
|
'%s' % project,
|
||||||
u'%s Documentation' % project,
|
'%s Documentation' % project,
|
||||||
u'OpenStack Foundation',
|
'OpenStack Foundation',
|
||||||
'%s' % project,
|
'%s' % project,
|
||||||
'Database as a service.',
|
'Database as a service.',
|
||||||
'Miscellaneous'
|
'Miscellaneous'
|
||||||
@ -243,10 +243,10 @@ texinfo_documents = [
|
|||||||
# -- Options for Epub output --------------------------------------------------
|
# -- Options for Epub output --------------------------------------------------
|
||||||
|
|
||||||
# Bibliographic Dublin Core info.
|
# Bibliographic Dublin Core info.
|
||||||
epub_title = u'%s' % project
|
epub_title = '%s' % project
|
||||||
epub_author = u'OpenStack Foundation'
|
epub_author = 'OpenStack Foundation'
|
||||||
epub_publisher = u'OpenStack Foundation'
|
epub_publisher = 'OpenStack Foundation'
|
||||||
epub_copyright = u'2013, OpenStack Foundation'
|
epub_copyright = '2013, OpenStack Foundation'
|
||||||
|
|
||||||
# The language of the text. It defaults to the language option
|
# The language of the text. It defaults to the language option
|
||||||
# or en if the language is not set.
|
# or en if the language is not set.
|
||||||
|
@ -62,8 +62,8 @@ source_suffix = '.rst'
|
|||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'Trove Release Notes'
|
project = 'Trove Release Notes'
|
||||||
copyright = u'2015, Trove Developers'
|
copyright = '2015, Trove Developers'
|
||||||
|
|
||||||
# Release notes are version independent.
|
# Release notes are version independent.
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
@ -214,8 +214,8 @@ latex_elements = {
|
|||||||
# (source start file, target name, title,
|
# (source start file, target name, title,
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'TroveReleaseNotes.tex', u'Trove Release Notes Documentation',
|
('index', 'TroveReleaseNotes.tex', 'Trove Release Notes Documentation',
|
||||||
u'Trove Developers', 'manual'),
|
'Trove Developers', '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
|
||||||
@ -244,8 +244,8 @@ latex_documents = [
|
|||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('index', 'trovereleasenotes', u'Trove Release Notes Documentation',
|
('index', 'trovereleasenotes', 'Trove Release Notes Documentation',
|
||||||
[u'Trove Developers'], 1)
|
['Trove Developers'], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
# If true, show URL addresses after external links.
|
||||||
@ -258,8 +258,8 @@ man_pages = [
|
|||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
('index', 'TroveReleaseNotes', u'Trove Release Notes Documentation',
|
('index', 'TroveReleaseNotes', 'Trove Release Notes Documentation',
|
||||||
u'Trove Developers', 'TroveReleaseNotes',
|
'Trove Developers', 'TroveReleaseNotes',
|
||||||
'One line description of project.',
|
'One line description of project.',
|
||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
@ -224,8 +224,8 @@ class MongoDbCluster(models.Cluster):
|
|||||||
required=True))
|
required=True))
|
||||||
volume_size = int(_check_option('volume', required=True)['size'])
|
volume_size = int(_check_option('volume', required=True)['size'])
|
||||||
instance_type = _check_option('type', required=True,
|
instance_type = _check_option('type', required=True,
|
||||||
valid_values=[u'replica',
|
valid_values=['replica',
|
||||||
u'query_router'])
|
'query_router'])
|
||||||
name = _check_option('name')
|
name = _check_option('name')
|
||||||
related_to = _check_option('related_to')
|
related_to = _check_option('related_to')
|
||||||
nics = _check_option('nics')
|
nics = _check_option('nics')
|
||||||
|
@ -55,14 +55,14 @@ class FakeSwiftConnection(object):
|
|||||||
|
|
||||||
def get_auth(self):
|
def get_auth(self):
|
||||||
return (
|
return (
|
||||||
u"http://127.0.0.1:8080/v1/AUTH_c7b038976df24d96bf1980f5da17bd89",
|
"http://127.0.0.1:8080/v1/AUTH_c7b038976df24d96bf1980f5da17bd89",
|
||||||
u'MIINrwYJKoZIhvcNAQcCoIINoDCCDZwCAQExCTAHBgUrDgMCGjCCDIgGCSqGSIb3'
|
'MIINrwYJKoZIhvcNAQcCoIINoDCCDZwCAQExCTAHBgUrDgMCGjCCDIgGCSqGSIb3'
|
||||||
u'DQEHAaCCDHkEggx1eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAi'
|
'DQEHAaCCDHkEggx1eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAi'
|
||||||
u'MjAxMy0wMy0xOFQxODoxMzoyMC41OTMyNzYiLCAiZXhwaXJlcyI6ICIyMDEzLTAz'
|
'MjAxMy0wMy0xOFQxODoxMzoyMC41OTMyNzYiLCAiZXhwaXJlcyI6ICIyMDEzLTAz'
|
||||||
u'LTE5VDE4OjEzOjIwWiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7'
|
'LTE5VDE4OjEzOjIwWiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7'
|
||||||
u'ImVuYWJsZWQiOiB0cnVlLCAiZGVzY3JpcHRpb24iOiBudWxsLCAibmFtZSI6ICJy'
|
'ImVuYWJsZWQiOiB0cnVlLCAiZGVzY3JpcHRpb24iOiBudWxsLCAibmFtZSI6ICJy'
|
||||||
u'ZWRkd2FyZiIsICJpZCI6ICJjN2IwMzg5NzZkZjI0ZDk2YmYxOTgwZjVkYTE3YmQ4'
|
'ZWRkd2FyZiIsICJpZCI6ICJjN2IwMzg5NzZkZjI0ZDk2YmYxOTgwZjVkYTE3YmQ4'
|
||||||
u'OSJ9fSwgInNlcnZpY2VDYXRhbG9nIjogW3siZW5kcG9pbnRzIjogW3siYWRtaW5')
|
'OSJ9fSwgInNlcnZpY2VDYXRhbG9nIjogW3siZW5kcG9pbnRzIjogW3siYWRtaW5')
|
||||||
|
|
||||||
def get_account(self):
|
def get_account(self):
|
||||||
return ({'content-length': '2', 'accept-ranges': 'bytes',
|
return ({'content-length': '2', 'accept-ranges': 'bytes',
|
||||||
@ -337,14 +337,14 @@ class SwiftClientStub(Patcher):
|
|||||||
'x-account-object-count': '0'}, self._containers_list)
|
'x-account-object-count': '0'}, self._containers_list)
|
||||||
|
|
||||||
get_auth_return_value = (
|
get_auth_return_value = (
|
||||||
u"http://127.0.0.1:8080/v1/AUTH_c7b038976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W3siYWRtaW5')
|
||||||
|
|
||||||
get_auth_patcher = patch.object(
|
get_auth_patcher = patch.object(
|
||||||
swift_client.Connection, 'get_auth',
|
swift_client.Connection, 'get_auth',
|
||||||
|
@ -547,7 +547,7 @@ class OrderingTests(trove_testtools.TestCase):
|
|||||||
backups, marker = models.Backup.list(self.context)
|
backups, marker = models.Backup.list(self.context)
|
||||||
self.assertIsNone(marker)
|
self.assertIsNone(marker)
|
||||||
actual = [b.name for b in backups]
|
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)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
def test_list_for_instance(self):
|
def test_list_for_instance(self):
|
||||||
@ -555,7 +555,7 @@ class OrderingTests(trove_testtools.TestCase):
|
|||||||
self.instance_id)
|
self.instance_id)
|
||||||
self.assertIsNone(marker)
|
self.assertIsNone(marker)
|
||||||
actual = [b.name for b in backups]
|
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)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class TestAuth(trove_testtools.TestCase):
|
|||||||
req = webob.Request.blank(url)
|
req = webob.Request.blank(url)
|
||||||
|
|
||||||
# test string with chinese characters
|
# test string with chinese characters
|
||||||
test_str = u'\u6d4b\u8bd5'
|
test_str = '\u6d4b\u8bd5'
|
||||||
req.headers = {
|
req.headers = {
|
||||||
'X-Tenant-ID': tenant_id,
|
'X-Tenant-ID': tenant_id,
|
||||||
'X-Auth-Project-Id': test_str
|
'X-Auth-Project-Id': test_str
|
||||||
|
@ -33,7 +33,7 @@ class TestEncryptUtils(trove_testtools.TestCase):
|
|||||||
def test_encode_decode_string(self):
|
def test_encode_decode_string(self):
|
||||||
random_data = bytearray(os.urandom(12))
|
random_data = bytearray(os.urandom(12))
|
||||||
data = [b'abc', b'numbers01234', b'\x00\xFF\x00\xFF\xFF\x00',
|
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:
|
for datum in data:
|
||||||
encoded_data = crypto_utils.encode_data(datum)
|
encoded_data = crypto_utils.encode_data(datum)
|
||||||
@ -81,7 +81,7 @@ class TestEncryptUtils(trove_testtools.TestCase):
|
|||||||
'P/RRPT'),
|
'P/RRPT'),
|
||||||
|
|
||||||
# Unicoded string (encoded to UTF-8)
|
# Unicoded string (encoded to UTF-8)
|
||||||
(u'Unicode:\u20ac',
|
('Unicode:\u20ac',
|
||||||
'eHh4eHh4eHh4eHh4eHh4eAMsI5YsrtMNAPJfVF0j9NegXML7OsJ0LuAy66'
|
'eHh4eHh4eHh4eHh4eHh4eAMsI5YsrtMNAPJfVF0j9NegXML7OsJ0LuAy66'
|
||||||
'LKv5F4'),
|
'LKv5F4'),
|
||||||
):
|
):
|
||||||
@ -99,7 +99,7 @@ class TestEncryptUtils(trove_testtools.TestCase):
|
|||||||
'KNN0NH',
|
'KNN0NH',
|
||||||
b'Hello World!'),
|
b'Hello World!'),
|
||||||
|
|
||||||
# Unicoded string: u'Unicode:\u20ac'
|
# Unicoded string: 'Unicode:\u20ac'
|
||||||
('ZUhoNGVIaDRlSGg0ZUhoNIHZLIuIcQCRwWY7PR2y7JcqoDf4ViqXIfh0uE'
|
('ZUhoNGVIaDRlSGg0ZUhoNIHZLIuIcQCRwWY7PR2y7JcqoDf4ViqXIfh0uE'
|
||||||
'Rbg9BA',
|
'Rbg9BA',
|
||||||
b'Unicode:\xe2\x82\xac'),
|
b'Unicode:\xe2\x82\xac'),
|
||||||
|
@ -177,12 +177,12 @@ class TestUtils(trove_testtools.TestCase):
|
|||||||
|
|
||||||
def test_req_to_text(self):
|
def test_req_to_text(self):
|
||||||
req = webob.Request.blank('/')
|
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))
|
self.assertEqual(expected, utils.req_to_text(req))
|
||||||
|
|
||||||
# add a header containing unicode characters
|
# add a header containing unicode characters
|
||||||
req.headers.update({
|
req.headers.update({
|
||||||
'X-Auth-Project-Id': u'\u6d4b\u8bd5'})
|
'X-Auth-Project-Id': '\u6d4b\u8bd5'})
|
||||||
expected = (u'GET / HTTP/1.0\r\nHost: localhost:80\r\n'
|
expected = ('GET / HTTP/1.0\r\nHost: localhost:80\r\n'
|
||||||
u'X-Auth-Project-Id: \u6d4b\u8bd5')
|
'X-Auth-Project-Id: \u6d4b\u8bd5')
|
||||||
self.assertEqual(expected, utils.req_to_text(req))
|
self.assertEqual(expected, utils.req_to_text(req))
|
||||||
|
Loading…
Reference in New Issue
Block a user