Merge "remove unicode from code"
This commit is contained in:
commit
7cbec53543
@ -92,8 +92,8 @@ source_suffix = '.rst'
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Neutron'
|
||||
copyright = u'2011-present, OpenStack Foundation.'
|
||||
project = 'Neutron'
|
||||
copyright = '2011-present, OpenStack Foundation.'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
@ -216,8 +216,8 @@ htmlhelp_basename = 'neutrondoc'
|
||||
# (source start file, target name, title, author,
|
||||
# documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('pdf-index', 'doc-neutron.tex', u'Neutron Documentation',
|
||||
u'Neutron development team', 'manual'),
|
||||
('pdf-index', 'doc-neutron.tex', 'Neutron Documentation',
|
||||
'Neutron development team', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
|
@ -33,11 +33,11 @@ from neutron.tests import base
|
||||
|
||||
class FdbPopulationExtensionTestCase(base.BaseTestCase):
|
||||
|
||||
UPDATE_MSG = {u'device_owner': constants.DEVICE_OWNER_ROUTER_INTF,
|
||||
u'physical_network': u'physnet1',
|
||||
u'mac_address': u'fa:16:3e:ba:bc:21',
|
||||
u'port_id': u'17ceda02-43e1-48d8-beb6-35885b20cae6'}
|
||||
DELETE_MSG = {u'port_id': u'17ceda02-43e1-48d8-beb6-35885b20cae6'}
|
||||
UPDATE_MSG = {'device_owner': constants.DEVICE_OWNER_ROUTER_INTF,
|
||||
'physical_network': 'physnet1',
|
||||
'mac_address': 'fa:16:3e:ba:bc:21',
|
||||
'port_id': '17ceda02-43e1-48d8-beb6-35885b20cae6'}
|
||||
DELETE_MSG = {'port_id': '17ceda02-43e1-48d8-beb6-35885b20cae6'}
|
||||
|
||||
def setUp(self):
|
||||
super(FdbPopulationExtensionTestCase, self).setUp()
|
||||
|
@ -491,7 +491,7 @@ class SGServerRpcCallBackTestCase(test_sg.SecurityGroupDBTestCase):
|
||||
'security_group_id': sg2_id},
|
||||
{'direction': 'egress', 'ethertype': const.IPv6,
|
||||
'security_group_id': sg2_id},
|
||||
{'direction': u'ingress',
|
||||
{'direction': 'ingress',
|
||||
'source_ip_prefix': port_fixed_ip2 + '/32',
|
||||
'protocol': const.PROTO_NAME_TCP,
|
||||
'ethertype': const.IPv4,
|
||||
@ -553,13 +553,13 @@ class SGServerRpcCallBackTestCase(test_sg.SecurityGroupDBTestCase):
|
||||
'stateful': True},
|
||||
{'direction': 'egress', 'ethertype': const.IPv6,
|
||||
'stateful': True},
|
||||
{'direction': u'ingress',
|
||||
{'direction': 'ingress',
|
||||
'protocol': const.PROTO_NAME_TCP,
|
||||
'ethertype': const.IPv4,
|
||||
'port_range_max': 25, 'port_range_min': 24,
|
||||
'remote_group_id': sg2_id,
|
||||
'stateful': True},
|
||||
{'direction': u'ingress',
|
||||
{'direction': 'ingress',
|
||||
'protocol': const.PROTO_NAME_TCP,
|
||||
'ethertype': const.IPv4,
|
||||
'port_range_max': 27, 'port_range_min': 26,
|
||||
@ -694,13 +694,13 @@ class SGServerRpcCallBackTestCase(test_sg.SecurityGroupDBTestCase):
|
||||
'stateful': True},
|
||||
{'direction': 'egress', 'ethertype': const.IPv6,
|
||||
'stateful': True},
|
||||
{'direction': u'ingress',
|
||||
{'direction': 'ingress',
|
||||
'protocol': const.PROTO_NAME_TCP,
|
||||
'ethertype': const.IPv6,
|
||||
'port_range_max': 22, 'port_range_min': 22,
|
||||
'remote_group_id': sg1_id,
|
||||
'stateful': True},
|
||||
{'direction': u'ingress',
|
||||
{'direction': 'ingress',
|
||||
'protocol': const.PROTO_NAME_TCP,
|
||||
'ethertype': const.IPv6,
|
||||
'port_range_max': 23, 'port_range_min': 23,
|
||||
|
@ -138,7 +138,7 @@ class ResourceTestCase(base.BaseTestCase):
|
||||
return wsgi.JSONDeserializer()
|
||||
|
||||
def test_unmapped_neutron_error_with_json(self):
|
||||
msg = u'\u7f51\u7edc'
|
||||
msg = '\u7f51\u7edc'
|
||||
|
||||
class TestException(n_exc.NeutronException):
|
||||
message = msg
|
||||
@ -181,7 +181,7 @@ class ResourceTestCase(base.BaseTestCase):
|
||||
str(wsgi.JSONDeserializer().deserialize(res.body)))
|
||||
|
||||
def test_mapped_neutron_error_with_json(self):
|
||||
msg = u'\u7f51\u7edc'
|
||||
msg = '\u7f51\u7edc'
|
||||
|
||||
class TestException(n_exc.NeutronException):
|
||||
message = msg
|
||||
|
@ -139,7 +139,7 @@ class TestNovaNotify(base.BaseTestCase):
|
||||
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
|
||||
returned_obj = {'port':
|
||||
{'device_owner': DEVICE_OWNER_COMPUTE,
|
||||
'id': u'bee50827-bcee-4cc8-91c1-a27b0ce54222',
|
||||
'id': 'bee50827-bcee-4cc8-91c1-a27b0ce54222',
|
||||
'device_id': device_id}}
|
||||
|
||||
expected_event = {'server_uuid': device_id,
|
||||
@ -152,7 +152,7 @@ class TestNovaNotify(base.BaseTestCase):
|
||||
def test_create_floatingip_notify(self):
|
||||
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
|
||||
returned_obj = {'floatingip':
|
||||
{'port_id': u'bee50827-bcee-4cc8-91c1-a27b0ce54222'}}
|
||||
{'port_id': 'bee50827-bcee-4cc8-91c1-a27b0ce54222'}}
|
||||
|
||||
expected_event = {'server_uuid': device_id,
|
||||
'name': 'network-changed',
|
||||
@ -172,7 +172,7 @@ class TestNovaNotify(base.BaseTestCase):
|
||||
def test_delete_floatingip_notify(self):
|
||||
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
|
||||
returned_obj = {'floatingip':
|
||||
{'port_id': u'bee50827-bcee-4cc8-91c1-a27b0ce54222'}}
|
||||
{'port_id': 'bee50827-bcee-4cc8-91c1-a27b0ce54222'}}
|
||||
|
||||
expected_event = {'server_uuid': device_id,
|
||||
'name': 'network-changed',
|
||||
@ -202,7 +202,7 @@ class TestNovaNotify(base.BaseTestCase):
|
||||
def test_associate_floatingip_notify(self):
|
||||
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
|
||||
returned_obj = {'floatingip':
|
||||
{'port_id': u'5a39def4-3d3f-473d-9ff4-8e90064b9cc1'}}
|
||||
{'port_id': '5a39def4-3d3f-473d-9ff4-8e90064b9cc1'}}
|
||||
original_obj = {'port_id': None}
|
||||
|
||||
expected_event = {'server_uuid': device_id,
|
||||
|
@ -375,8 +375,8 @@ class TestL2PopulationRpcTestCase(test_plugin.Ml2PluginV2TestCase):
|
||||
host=HOST_4,
|
||||
refresh_tunnels=True)
|
||||
fanout_expected = {port['port']['network_id']: {
|
||||
'network_type': u'vxlan',
|
||||
'ports': {u'20.0.0.4': [('00:00:00:00:00:00', '0.0.0.0')]},
|
||||
'network_type': 'vxlan',
|
||||
'ports': {'20.0.0.4': [('00:00:00:00:00:00', '0.0.0.0')]},
|
||||
'segment_id': 1}}
|
||||
self.mock_fanout.assert_called_with(mock.ANY,
|
||||
'add_fdb_entries',
|
||||
@ -1490,13 +1490,13 @@ class TestL2PopulationMechDriver(base.BaseTestCase):
|
||||
self.assertEqual(expected_result, result)
|
||||
|
||||
def test_update_port_precommit_mac_address_changed_raises(self):
|
||||
port = {'status': u'ACTIVE',
|
||||
port = {'status': 'ACTIVE',
|
||||
'device_owner': DEVICE_OWNER_COMPUTE,
|
||||
'mac_address': u'12:34:56:78:4b:0e',
|
||||
'id': u'1'}
|
||||
'mac_address': '12:34:56:78:4b:0e',
|
||||
'id': '1'}
|
||||
|
||||
original_port = port.copy()
|
||||
original_port['mac_address'] = u'12:34:56:78:4b:0f'
|
||||
original_port['mac_address'] = '12:34:56:78:4b:0f'
|
||||
|
||||
with mock.patch.object(driver_context.segments_db,
|
||||
'get_network_segments'):
|
||||
|
@ -2619,7 +2619,7 @@ class TestOvsNeutronAgent(object):
|
||||
self.assertRaises(ValueError, self._make_agent)
|
||||
|
||||
def test__check_bridge_datapath_id(self):
|
||||
datapath_id = u'0000622486fa3f42'
|
||||
datapath_id = '0000622486fa3f42'
|
||||
datapath_ids_set = set()
|
||||
for i in range(5):
|
||||
dpid = format((i << 48) + int(datapath_id, 16), '0x').zfill(16)
|
||||
|
@ -167,7 +167,7 @@ class TestManagers(base.BaseTestCase):
|
||||
cfg.CONF.set_override('mechanism_drivers', ['faulty_agent'],
|
||||
group='ml2')
|
||||
self.assertRaises(SystemExit, managers.MechanismManager)
|
||||
mock_log.assert_called_once_with(u"The '%(entrypoint)s' entrypoint "
|
||||
mock_log.assert_called_once_with("The '%(entrypoint)s' entrypoint "
|
||||
"could not be loaded for the "
|
||||
"following reason: '%(reason)s'.",
|
||||
{'entrypoint': mock.ANY,
|
||||
|
@ -237,20 +237,20 @@ class LoggingRpcCallbackTestCase(test_sg.SecurityGroupDBTestCase):
|
||||
'port_id': port_id,
|
||||
'security_group_rules': [
|
||||
{'direction': 'egress',
|
||||
'ethertype': u'IPv4',
|
||||
'ethertype': 'IPv4',
|
||||
'security_group_id': sg_id},
|
||||
{'direction': 'egress',
|
||||
'ethertype': u'IPv6',
|
||||
'ethertype': 'IPv6',
|
||||
'security_group_id': sg_id},
|
||||
{'direction': 'ingress',
|
||||
'ethertype': u'IPv4',
|
||||
'ethertype': 'IPv4',
|
||||
'port_range_max': 22,
|
||||
'port_range_min': 22,
|
||||
'protocol': u'tcp',
|
||||
'protocol': 'tcp',
|
||||
'security_group_id': sg_id},
|
||||
{'direction': 'egress',
|
||||
'ethertype': u'IPv4',
|
||||
'protocol': u'tcp',
|
||||
'ethertype': 'IPv4',
|
||||
'protocol': 'tcp',
|
||||
'dest_ip_prefix':
|
||||
net_utils.AuthenticIPNetwork(
|
||||
'10.0.0.1/32'),
|
||||
@ -312,23 +312,23 @@ class LoggingRpcCallbackTestCase(test_sg.SecurityGroupDBTestCase):
|
||||
'port_id': port_id,
|
||||
'security_group_rules': [
|
||||
{'direction': 'egress',
|
||||
'ethertype': u'IPv4',
|
||||
'ethertype': 'IPv4',
|
||||
'security_group_id': sg_id},
|
||||
{'direction': 'egress',
|
||||
'ethertype': u'IPv6',
|
||||
'ethertype': 'IPv6',
|
||||
'security_group_id': sg_id},
|
||||
{'direction': 'ingress',
|
||||
'ethertype': u'IPv4',
|
||||
'ethertype': 'IPv4',
|
||||
'port_range_max': 13,
|
||||
'port_range_min': 11,
|
||||
'protocol': u'tcp',
|
||||
'protocol': 'tcp',
|
||||
'source_ip_prefix':
|
||||
net_utils.AuthenticIPNetwork(
|
||||
'10.0.0.1/32'),
|
||||
'security_group_id': sg_id},
|
||||
{'direction': 'egress',
|
||||
'ethertype': u'IPv4',
|
||||
'protocol': u'icmp',
|
||||
'ethertype': 'IPv4',
|
||||
'protocol': 'icmp',
|
||||
'security_group_id': sg_id}]
|
||||
}],
|
||||
'project_id': tenant_id
|
||||
|
@ -260,7 +260,7 @@ class SerializerTest(base.BaseTestCase):
|
||||
serializer = wsgi.Serializer()
|
||||
result = serializer.deserialize(data_string, content_type)
|
||||
|
||||
self.assertEqual({'body': {u'servers': [u'test=pass']}}, result)
|
||||
self.assertEqual({'body': {'servers': ['test=pass']}}, result)
|
||||
|
||||
|
||||
class RequestDeserializerTest(testtools.TestCase):
|
||||
@ -520,7 +520,7 @@ class JSONDictSerializerTest(base.BaseTestCase):
|
||||
self.assertEqual(expected_json, result)
|
||||
|
||||
def test_json_with_unicode(self):
|
||||
input_dict = dict(servers=dict(a=(2, u'\u7f51\u7edc')))
|
||||
input_dict = dict(servers=dict(a=(2, '\u7f51\u7edc')))
|
||||
expected_json = b'{"servers":{"a":[2,"\\u7f51\\u7edc"]}}'
|
||||
serializer = wsgi.JSONDictSerializer()
|
||||
result = serializer.serialize(input_dict)
|
||||
@ -572,14 +572,14 @@ class JSONDeserializerTest(base.BaseTestCase):
|
||||
|
||||
def test_json_with_utf8(self):
|
||||
data = b'{"a": "\xe7\xbd\x91\xe7\xbb\x9c"}'
|
||||
as_dict = {'body': {'a': u'\u7f51\u7edc'}}
|
||||
as_dict = {'body': {'a': '\u7f51\u7edc'}}
|
||||
deserializer = wsgi.JSONDeserializer()
|
||||
self.assertEqual(as_dict,
|
||||
deserializer.deserialize(data))
|
||||
|
||||
def test_json_with_unicode(self):
|
||||
data = b'{"a": "\u7f51\u7edc"}'
|
||||
as_dict = {'body': {'a': u'\u7f51\u7edc'}}
|
||||
as_dict = {'body': {'a': '\u7f51\u7edc'}}
|
||||
deserializer = wsgi.JSONDeserializer()
|
||||
self.assertEqual(as_dict,
|
||||
deserializer.deserialize(data))
|
||||
|
@ -60,8 +60,8 @@ source_suffix = '.rst'
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Neutron Release Notes'
|
||||
copyright = u'2015, Neutron Developers'
|
||||
project = 'Neutron Release Notes'
|
||||
copyright = '2015, Neutron Developers'
|
||||
|
||||
# Release notes are version independent
|
||||
# The short X.Y version.
|
||||
@ -209,8 +209,8 @@ latex_elements = {
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
('index', 'NeutronReleaseNotes.tex',
|
||||
u'Neutron Release Notes Documentation',
|
||||
u'Neutron Developers', 'manual'),
|
||||
'Neutron Release Notes Documentation',
|
||||
'Neutron Developers', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
@ -239,8 +239,8 @@ latex_documents = [
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'neutronreleasenotes', u'Neutron Release Notes Documentation',
|
||||
[u'Neutron Developers'], 1)
|
||||
('index', 'neutronreleasenotes', 'Neutron Release Notes Documentation',
|
||||
['Neutron Developers'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
@ -253,8 +253,8 @@ man_pages = [
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'NeutronReleaseNotes', u'Neutron Release Notes Documentation',
|
||||
u'Neutron Developers', 'NeutronReleaseNotes',
|
||||
('index', 'NeutronReleaseNotes', 'Neutron Release Notes Documentation',
|
||||
'Neutron Developers', 'NeutronReleaseNotes',
|
||||
'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user