remove unicode from code

Change-Id: Id3b9bad4bc617c168200d34d69bbe760a24dfcf0
This commit is contained in:
songwenping 2021-01-03 17:35:15 +08:00
parent 011b95768f
commit ab8b1eae4e
8 changed files with 34 additions and 34 deletions

View File

@ -63,8 +63,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'Masakari API Reference'
copyright = u'2017-present, OpenStack Foundation'
project = 'Masakari API Reference'
copyright = '2017-present, OpenStack Foundation'
# openstackdocstheme optionns
openstackdocs_repo_name = 'openstack/masakari'
@ -104,7 +104,7 @@ pygments_style = 'native'
# ----------------------------------------------
# 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
@ -195,8 +195,8 @@ htmlhelp_basename = 'masakaridoc'
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [('index', 'Masakari.tex',
u'OpenStack Masakari API Documentation',
u'OpenStack Foundation', 'manual'),
'OpenStack Masakari API Documentation',
'OpenStack Foundation', 'manual'),
]
# The name of an image file (relative to this directory) to place at

View File

@ -55,8 +55,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'masakari'
copyright = u'2016, OpenStack Foundation'
project = 'masakari'
copyright = '2016, OpenStack Foundation'
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
@ -91,8 +91,8 @@ htmlhelp_basename = '%sdoc' % project
latex_documents = [
('index',
'%s.tex' % project,
u'%s Documentation' % project,
u'OpenStack Foundation', 'manual'),
'%s Documentation' % project,
'OpenStack Foundation', 'manual'),
]
# Example configuration for intersphinx: refer to the Python standard library.

View File

@ -202,10 +202,10 @@ class JSONDeserializerTest(test.NoDBTestCase):
}} """
as_dict = {
'body': {
u'segment': {u'recovery_method': 'auto',
u'name': u'\u6982\u5ff5',
u'service_type': u'COMPUTE_HOST'
}
'segment': {'recovery_method': 'auto',
'name': '\u6982\u5ff5',
'service_type': 'COMPUTE_HOST'
}
}
}
deserializer = wsgi.JSONDeserializer()
@ -874,8 +874,8 @@ class ResourceTest(MicroversionedTest):
def test_resource_headers_py2_are_utf8(self):
resp = webob.Response(status_int=http.ACCEPTED)
resp.headers['x-header1'] = 1
resp.headers['x-header2'] = u'header2'
resp.headers['x-header3'] = u'header3'
resp.headers['x-header2'] = 'header2'
resp.headers['x-header3'] = 'header3'
class Controller(object):
def index(self, req):
@ -886,8 +886,8 @@ class ResourceTest(MicroversionedTest):
response = req.get_response(app)
self.assertEqual('1', response.headers['x-header1'])
self.assertEqual(u'header2', response.headers['x-header2'])
self.assertEqual(u'header3', response.headers['x-header3'])
self.assertEqual('header2', response.headers['x-header2'])
self.assertEqual('header3', response.headers['x-header3'])
def test_resource_valid_utf8_body(self):
class Controller(object):

View File

@ -235,7 +235,7 @@ class TestNotificationBase(test.NoDBTestCase):
expected_event_type='segment.create',
expected_payload={
'masakari_object.name': 'TestNotificationPayloadEmptySchema',
'masakari_object.data': {'extra_field': u'test string'},
'masakari_object.data': {'extra_field': 'test string'},
'masakari_object.version': '1.0',
'masakari_object.namespace': 'masakari'})

View File

@ -134,9 +134,9 @@ class TestHostObject(test_objects._LocalTest):
mock_db_create.assert_called_once_with(self.context, {
'failover_segment_id': uuidsentinel.fake_segment,
'on_maintenance': False, 'uuid': uuidsentinel.fake_host,
'reserved': False, 'name': u'foo-host',
'control_attributes': u'fake_attributes',
'type': u'fake-type'})
'reserved': False, 'name': 'foo-host',
'control_attributes': 'fake_attributes',
'type': 'fake-type'})
action = fields.EventNotificationAction.HOST_CREATE
phase_start = fields.EventNotificationPhase.START
phase_end = fields.EventNotificationPhase.END

View File

@ -260,6 +260,6 @@ class TestNotificationObject(test_objects._LocalTest):
'notificati'
'on_uuid': uuidsentinel.fake_notification,
'status': 'new', 'generated_time': NOW,
'payload': {'fake_key': u'fake_value'},
'payload': {'fake_key': 'fake_value'},
'type': 'COMPUTE_HOST'}
))

View File

@ -504,9 +504,9 @@ class NameTestCase(APIValidationTestCase):
self.assertEqual('Validation succeeded.',
self.post(body={'foo': 'a'}, req=FakeRequest()))
self.assertEqual('Validation succeeded.',
self.post(body={'foo': u'\u0434'}, req=FakeRequest()))
self.post(body={'foo': '\u0434'}, req=FakeRequest()))
self.assertEqual('Validation succeeded.',
self.post(body={'foo': u'\u0434\u2006\ufffd'},
self.post(body={'foo': '\u0434\u2006\ufffd'},
req=FakeRequest()))
def test_validate_name_fails(self):
@ -517,8 +517,8 @@ class NameTestCase(APIValidationTestCase):
should_fail = (' ',
' segment',
'segment ',
u'a\xa0', # trailing unicode space
u'\uffff', # non-printable unicode
'a\xa0', # trailing unicode space
'\uffff', # non-printable unicode
)
for item in should_fail:
@ -527,7 +527,7 @@ class NameTestCase(APIValidationTestCase):
# four-byte unicode, if supported by this python build
try:
self.check_validation_error(self.post, body={'foo': u'\U00010000'},
self.check_validation_error(self.post, body={'foo': '\U00010000'},
expected_detail=error)
except ValueError:
pass

View File

@ -55,8 +55,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'Masakari Release Notes'
copyright = u'2016, OpenStack Foundation'
project = 'Masakari Release Notes'
copyright = '2016, OpenStack Foundation'
# Release notes are version independent.
# The short X.Y version.
@ -206,7 +206,7 @@ latex_elements = {
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'MasakariReleaseNotes.tex',
u'Masakari Release Notes Documentation', u'Masakari Developers',
'Masakari Release Notes Documentation', 'Masakari Developers',
'manual'),
]
@ -236,8 +236,8 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'masakarireleasenotes', u'Masakari Release Notes Documentation',
[u'Masakari Developers'], 1)
('index', 'masakarireleasenotes', 'Masakari Release Notes Documentation',
['Masakari Developers'], 1)
]
# If true, show URL addresses after external links.
@ -250,8 +250,8 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'MasakariReleaseNotes', u'Masakari Release Notes Documentation',
u'Masakari Developers', 'MasakariReleaseNotes',
('index', 'MasakariReleaseNotes', 'Masakari Release Notes Documentation',
'Masakari Developers', 'MasakariReleaseNotes',
'One line description of project.',
'Miscellaneous'),
]