Fix use-maxsplit-arg warnings
Noticed a few test files had these warnings, fixed them. No functional change. TrivialFix Change-Id: I082baf04588e3f96a975c8fb2d74b5ec1b987801
This commit is contained in:
parent
a89b5e5772
commit
3d8460c222
neutron/tests/unit
@ -2282,7 +2282,7 @@ class TestDeviceManager(base.BaseTestCase):
|
||||
expected = ('dhcp1ae5f96c-c527-5079-82ea-371a01645457-12345678-1234-'
|
||||
'5678-1234567890ab')
|
||||
# the DHCP port name only contains the hostname and not the domain name
|
||||
local_hostname = cfg.CONF.host.split('.')[0]
|
||||
local_hostname = cfg.CONF.host.split('.', maxsplit=1)[0]
|
||||
|
||||
with mock.patch('uuid.uuid5') as uuid5:
|
||||
uuid5.return_value = '1ae5f96c-c527-5079-82ea-371a01645457'
|
||||
|
@ -1468,12 +1468,14 @@ class TestDnsmasq(TestBase):
|
||||
s.ipv6_address_mode == constants.DHCPV6_STATEFUL):
|
||||
if s.ip_version == constants.IP_VERSION_4:
|
||||
expected.extend([prefix % (
|
||||
s.id, s.cidr.split('/')[0],
|
||||
s.id, s.cidr.split('/', maxsplit=1)[0],
|
||||
netaddr.IPNetwork(s.cidr).netmask, lease_duration,
|
||||
seconds)])
|
||||
else:
|
||||
expected.extend([prefix6 % (
|
||||
s.id, s.cidr.split('/')[0], s.cidr.split('/')[1],
|
||||
s.id,
|
||||
s.cidr.split('/', maxsplit=1)[0],
|
||||
s.cidr.split('/', maxsplit=1)[1],
|
||||
lease_duration, seconds)])
|
||||
possible_leases += netaddr.IPNetwork(s.cidr).size
|
||||
|
||||
|
@ -461,7 +461,8 @@ class FlavorPluginTestCase(test_db_base_plugin_v2.NeutronDbPluginV2TestCase,
|
||||
self.service_providers.return_value = providers
|
||||
for provider in providers:
|
||||
self.service_manager.add_provider_configuration(
|
||||
provider.split(':')[0], provconf.ProviderConfiguration())
|
||||
provider.split(':', maxsplit=1)[0],
|
||||
provconf.ProviderConfiguration())
|
||||
|
||||
db_api.CONTEXT_WRITER.get_engine()
|
||||
|
||||
|
@ -244,7 +244,7 @@ class ServiceTypeManagerExtTestCase(ServiceTypeExtensionTestCaseBase):
|
||||
st_db.ServiceTypeManager._instance = None
|
||||
self.manager = st_db.ServiceTypeManager.get_instance()
|
||||
for provider in service_providers:
|
||||
service_type = provider.split(':')[0]
|
||||
service_type = provider.split(':', maxsplit=1)[0]
|
||||
self.manager.add_provider_configuration(
|
||||
service_type, provconf.ProviderConfiguration(
|
||||
svc_type=service_type))
|
||||
|
Loading…
x
Reference in New Issue
Block a user