Browse Source

Merge "Allow usage of duplicated IPs for undercloud config" into stable/ussuri

changes/97/749897/1
Zuul 1 month ago
committed by Gerrit Code Review
parent
commit
fcb6327a5a
2 changed files with 5 additions and 15 deletions
  1. +2
    -6
      tripleoclient/tests/v1/undercloud/test_config.py
  2. +3
    -9
      tripleoclient/v1/undercloud_config.py

+ 2
- 6
tripleoclient/tests/v1/undercloud/test_config.py View File

@@ -322,18 +322,14 @@ class TestNetworkSettings(TestBaseNetworkSettings):
undercloud_admin_host='192.168.24.3',
undercloud_public_host='192.168.24.1',
generate_service_certificate=True)
self.assertRaises(exceptions.InvalidConfiguration,
undercloud_config._process_network_args,
env)
undercloud_config._process_network_args(env)

# undercloud_admin_host == undercloud_public_host
self.conf.config(local_ip='192.168.24.1/24',
undercloud_admin_host='192.168.24.2',
undercloud_public_host='192.168.24.2',
generate_service_certificate=True)
self.assertRaises(exceptions.InvalidConfiguration,
undercloud_config._process_network_args,
env)
undercloud_config._process_network_args(env)

# We do not care about ip duplication when ssl is disabled
self.conf.config(local_ip='192.168.24.1/24',


+ 3
- 9
tripleoclient/v1/undercloud_config.py View File

@@ -408,15 +408,9 @@ def _process_network_args(env):
# value here.
if (CONF.get('generate_service_certificate') or
CONF.get('undercloud_service_certificate')):
undercloud_ips = [
CONF.local_ip.split('/')[0],
CONF.undercloud_admin_host,
CONF.undercloud_public_host
]
if len(undercloud_ips) != len(set(undercloud_ips)):
msg = ("The same IP is used for multiple endpoints. Please use "
"unique ips for local_ip, undercloud_admin_host and "
"undercloud_public_host")
if CONF.local_ip.split('/')[0] == CONF.undercloud_admin_host:
msg = ("Different IPs should be assigned to local_ip and "
"undercloud_admin_host")
raise exceptions.InvalidConfiguration(msg)




Loading…
Cancel
Save