remove unicode from code

remove unicode from code

Change-Id: Iee0bca6009d0cd9edb66fc787bf8452ba9de253d
This commit is contained in:
shanyunfan33 2021-12-24 14:41:36 +08:00
parent 76b9a09591
commit 64b2f2bde0
6 changed files with 33 additions and 33 deletions

View File

@ -58,8 +58,8 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'Networking API Reference' project = 'Networking API Reference'
copyright = u'2010-present, OpenStack Foundation' copyright = '2010-present, OpenStack Foundation'
# openstackdocstheme options # openstackdocstheme options
openstackdocs_repo_name = 'openstack/neutron-lib' openstackdocs_repo_name = 'openstack/neutron-lib'
@ -189,8 +189,8 @@ htmlhelp_basename = 'neutrondoc'
# (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', 'Neutron.tex', u'OpenStack Networking API Documentation', ('index', 'Neutron.tex', 'OpenStack Networking 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

View File

@ -56,8 +56,8 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'Neutron Library' project = 'Neutron Library'
copyright = u'2015-present, OpenStack Foundation.' copyright = '2015-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.
@ -191,8 +191,8 @@ html_theme = 'openstackdocs'
# (source start file, target name, title, author, # (source start file, target name, title, author,
# documentclass [howto/manual]). # documentclass [howto/manual]).
latex_documents = [ latex_documents = [
('index', 'doc-neutron-lib.tex', u'Neutron Library Documentation', ('index', 'doc-neutron-lib.tex', 'Neutron Library Documentation',
u'Neutron development team', 'manual'), 'Neutron development team', '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

View File

@ -177,23 +177,23 @@ class TestConvertIPv6AddrCanonicalFormat(base.BaseTestCase):
def test_convert_ipv6_address_extended_add_with_zeroes(self): def test_convert_ipv6_address_extended_add_with_zeroes(self):
result = converters.convert_ip_to_canonical_format( result = converters.convert_ip_to_canonical_format(
u'2001:0db8:0:0:0:0:0:0001') '2001:0db8:0:0:0:0:0:0001')
self.assertEqual(u'2001:db8::1', result) self.assertEqual('2001:db8::1', result)
@testtools.skipIf(tools.is_bsd(), 'bug/1484837') @testtools.skipIf(tools.is_bsd(), 'bug/1484837')
def test_convert_ipv6_compressed_address_OSX_skip(self): def test_convert_ipv6_compressed_address_OSX_skip(self):
result = converters.convert_ip_to_canonical_format( result = converters.convert_ip_to_canonical_format(
u'2001:db8:0:1:1:1:1:1') '2001:db8:0:1:1:1:1:1')
self.assertEqual(u'2001:db8:0:1:1:1:1:1', result) self.assertEqual('2001:db8:0:1:1:1:1:1', result)
def test_convert_ipv6_extended_addr_to_compressed(self): def test_convert_ipv6_extended_addr_to_compressed(self):
result = converters.convert_ip_to_canonical_format( result = converters.convert_ip_to_canonical_format(
u"Fe80:0:0:0:0:0:0:1") u"Fe80:0:0:0:0:0:0:1")
self.assertEqual(u'fe80::1', result) self.assertEqual('fe80::1', result)
def test_convert_ipv4_address(self): def test_convert_ipv4_address(self):
result = converters.convert_ip_to_canonical_format(u"192.168.1.1") result = converters.convert_ip_to_canonical_format(u"192.168.1.1")
self.assertEqual(u'192.168.1.1', result) self.assertEqual('192.168.1.1', result)
def test_convert_None_address(self): def test_convert_None_address(self):
result = converters.convert_ip_to_canonical_format(None) result = converters.convert_ip_to_canonical_format(None)
@ -203,28 +203,28 @@ class TestConvertIPv6AddrCanonicalFormat(base.BaseTestCase):
result = converters.convert_ip_to_canonical_format("on") result = converters.convert_ip_to_canonical_format("on")
self.assertEqual("on", result) self.assertEqual("on", result)
result = converters.convert_ip_to_canonical_format( result = converters.convert_ip_to_canonical_format(
u'192.168.1.1/32') '192.168.1.1/32')
self.assertEqual(u'192.168.1.1/32', result) self.assertEqual('192.168.1.1/32', result)
result = converters.convert_ip_to_canonical_format( result = converters.convert_ip_to_canonical_format(
u'2001:db8:0:1:1:1:1:1/128') '2001:db8:0:1:1:1:1:1/128')
self.assertEqual(u'2001:db8:0:1:1:1:1:1/128', result) self.assertEqual('2001:db8:0:1:1:1:1:1/128', result)
class TestConvertIPv6CIDRCanonicalFormat(base.BaseTestCase): class TestConvertIPv6CIDRCanonicalFormat(base.BaseTestCase):
def test_convert_ipv4_address_with_CIDR(self): def test_convert_ipv4_address_with_CIDR(self):
result = converters.convert_cidr_to_canonical_format(u'192.168.1.1/24') result = converters.convert_cidr_to_canonical_format('192.168.1.1/24')
self.assertEqual(u'192.168.1.1/24', result) self.assertEqual('192.168.1.1/24', result)
def test_convert_ipv6_extended_addr_withcidr_to_compressed(self): def test_convert_ipv6_extended_addr_withcidr_to_compressed(self):
result = converters.convert_cidr_to_canonical_format( result = converters.convert_cidr_to_canonical_format(
u'Fe80:0:0:0:0:0:0:1/64') 'Fe80:0:0:0:0:0:0:1/64')
self.assertEqual(u'fe80::1/64', result) self.assertEqual('fe80::1/64', result)
def test_convert_non_ip_addr_with_slash(self): def test_convert_non_ip_addr_with_slash(self):
with testtools.ExpectedException(n_exc.InvalidInput): with testtools.ExpectedException(n_exc.InvalidInput):
converters.convert_cidr_to_canonical_format( converters.convert_cidr_to_canonical_format(
u"Dormamu/DarkSeid/Vulture") "Dormamu/DarkSeid/Vulture")
class TestConvertStringToCaseInsensitive(base.BaseTestCase): class TestConvertStringToCaseInsensitive(base.BaseTestCase):

View File

@ -106,7 +106,7 @@ class TestDeadLockDecorator(_base.BaseTestCase):
retry_fixture.cleanUp() retry_fixture.cleanUp()
def test_mysql_savepoint_error(self): def test_mysql_savepoint_error(self):
e = db_exc.DBError("(pymysql.err.InternalError) (1305, u'SAVEPOINT " e = db_exc.DBError("(pymysql.err.InternalError) (1305, 'SAVEPOINT "
"sa_savepoint_1 does not exist')") "sa_savepoint_1 does not exist')")
self.assertIsNone(self._decorated_function(1, e)) self.assertIsNone(self._decorated_function(1, e))

View File

@ -51,7 +51,7 @@ class TestPlacementUtils(base.BaseTestCase):
# assertNotRaises # assertNotRaises
place_utils.six_uuid5( place_utils.six_uuid5(
namespace=self._uuid_ns, namespace=self._uuid_ns,
name=u'unicode string') name='unicode string')
except Exception: except Exception:
self.fail('could not generate uuid') self.fail('could not generate uuid')

View File

@ -54,8 +54,8 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'Neutron Library Release Notes' project = 'Neutron Library Release Notes'
copyright = u'2016, Neutron Library Developers' copyright = '2016, Neutron Library Developers'
# Release notes are version independent. # Release notes are version independent.
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
@ -201,8 +201,8 @@ latex_elements = {
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
('index', 'NeutronLibReleaseNotes.tex', ('index', 'NeutronLibReleaseNotes.tex',
u'Neutron Library Notes Documentation', 'Neutron Library Notes Documentation',
u'Neutron Library Developers', 'manual'), 'Neutron Library 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
@ -231,9 +231,9 @@ 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', 'neutronlibreleasenotes', u'Neutron Library', ('index', 'neutronlibreleasenotes', 'Neutron Library',
'Neutron Library Release Notes Documentation', 'Neutron Library Release Notes Documentation',
[u'Neutron Library Developers'], ['Neutron Library Developers'],
1) 1)
] ]
@ -247,9 +247,9 @@ 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', 'NeutronLibReleaseNotes', u'Neutron Library', ('index', 'NeutronLibReleaseNotes', 'Neutron Library',
'Neutron Library Release Notes Documentation', 'Neutron Library Release Notes Documentation',
u'Neutron Library Developers', 'Neutron Library Developers',
'NeutronLibReleaseNotes', 'NeutronLibReleaseNotes',
'For sharing/decoupling neutron functionality across the Stadium.', 'For sharing/decoupling neutron functionality across the Stadium.',
'Miscellaneous'), 'Miscellaneous'),