Merge "subcloud add bootstrap does not take IPv6 address"

This commit is contained in:
Zuul 2019-09-17 21:13:09 +00:00 committed by Gerrit Code Review
commit 9bfb24ff4a
3 changed files with 1 additions and 19 deletions

View File

@ -625,14 +625,6 @@ def test_region_config_validation():
# Test detection of an invalid PXEBOOT_CIDR
region_config = cr.parse_system_config(lag_vlan_regionfile)
region_config.set('REGION2_PXEBOOT_NETWORK', 'PXEBOOT_CIDR',
'192.168.1.4/24')
with pytest.raises(exceptions.ConfigFail):
cr.create_cgcs_config_file(None, region_config, None, None, None,
validate_only=True)
with pytest.raises(exceptions.ConfigFail):
validate(region_config, REGION_CONFIG, None, False)
region_config.set('REGION2_PXEBOOT_NETWORK', 'PXEBOOT_CIDR',
'FD00::0000/64')
with pytest.raises(exceptions.ConfigFail):

View File

@ -232,14 +232,6 @@ def test_system_config_validation():
# Test detection of an invalid PXEBOOT_CIDR
system_config = cr.parse_system_config(lag_vlan_systemfile)
system_config.set('PXEBOOT_NETWORK', 'PXEBOOT_CIDR',
'192.168.1.4/24')
with pytest.raises(exceptions.ConfigFail):
cr.create_cgcs_config_file(None, system_config, None, None, None, 0,
validate_only=True)
with pytest.raises(exceptions.ConfigFail):
validate(system_config, DEFAULT_CONFIG, None, False)
system_config.set('PXEBOOT_NETWORK', 'PXEBOOT_CIDR',
'FD00::0000/64')
with pytest.raises(exceptions.ConfigFail):

View File

@ -952,9 +952,7 @@ def validate_network_str(network_str, minimum_size,
"""Determine whether a network is valid."""
try:
network = netaddr.IPNetwork(network_str)
if network.ip != network.network:
raise ValidateFail("Invalid network address")
elif network.size < minimum_size:
if network.size < minimum_size:
raise ValidateFail("Subnet too small - must have at least %d "
"addresses" % minimum_size)
elif network.version == 6 and network.prefixlen < 64: