subcloud add bootstrap does not take IPv6 address
This update removes a check that enforces the IP address of IPNetwork object to be the same as the network, as per netaddr doc, IP may or may not be the same as the network. Change-Id: I27dd0d8ddab720fc8e739fa4b34a71232c032c7c Partial-Bug: 1844190 Signed-off-by: Tao Liu <tao.liu@windriver.com>
This commit is contained in:
parent
2f964d77e9
commit
b64fd7f54e
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue