diff --git a/src/server_mgr_main.py b/src/server_mgr_main.py index 24df517d..022c5f3a 100755 --- a/src/server_mgr_main.py +++ b/src/server_mgr_main.py @@ -861,7 +861,11 @@ def validate_non_openstack_cluster(self, cluster_id): else: msg = "Cluster with only Openstack role is supported only with new cluster params format with Openstack section\n" self.log_and_raise_exception(msg) - configured_external_keystone_ip = cluster_openstack_params.get("keystone_ip", None) + configured_external_keystone_params = cluster_openstack_params.get("keystone", None) + if configured_external_keystone_params: + configured_external_keystone_ip = configured_external_keystone_params.get("ip", None) + else: + configured_external_keystone_ip = None configured_nova_params = cluster_openstack_params.get("nova", None) if configured_nova_params: configured_nova_rabbit_servers = configured_nova_params.get("rabbit_hosts", None) @@ -870,7 +874,7 @@ def validate_non_openstack_cluster(self, cluster_id): if configured_external_keystone_ip and configured_nova_rabbit_servers: pass else: - msg = "In a Cluster with no Openstack role, you need to configure both openstack::keystone_ip and openstack::nova::rabbit_hosts to point to an external Openstack\n" + msg = "In a Cluster with no Openstack role, you need to configure both openstack::keystone::ip and openstack::nova::rabbit_hosts to point to an external Openstack\n" self.log_and_raise_exception(msg) def validate_openstack_only_cluster(self, cluster_id): @@ -3847,14 +3851,15 @@ def storage_get_control_network_mask( server_params = server.get('parameters', {}) cluster_openstack_prov_params = ( cluster_params.get("provision", {})).get("openstack", {}) - configured_external_keystone_ip = cluster_openstack_prov_params.get("keystone_ip", None) + configured_external_keystone_params = cluster_openstack_prov_params.get("keystone", None) + configured_external_keystone_ip = configured_external_keystone_params.get("ip", None) openstack_ip = '' self_ip = server.get("ip_address", "") if configured_external_keystone_ip: openstack_ip = configured_external_keystone_ip elif self_ip in role_ips_dict['openstack']: openstack_ip = self_ip - elif 'openstack' in role_ips_dict: + elif 'openstack' in role_ips_dict and len(role_ips_dict['openstack']): openstack_ip = role_ips_dict['openstack'][0] else: msg = "Openstack role not defined for cluster AND External Openstack not configured in cluster parameters.\n " \ @@ -3969,7 +3974,8 @@ def build_calculated_cluster_params( # Build mysql_allowed_hosts list contrail_ha_params = cluster_contrail_prov_params.get("ha", {}) openstack_ha_params = cluster_openstack_prov_params.get("ha", {}) - configured_external_keystone_ip = cluster_openstack_prov_params.get("keystone_ip", None) + configured_external_keystone_params = cluster_openstack_prov_params.get("keystone", None) + configured_external_keystone_ip = configured_external_keystone_params.get("ip", None) mysql_allowed_hosts = [] internal_vip = openstack_ha_params.get("internal_vip", None) if internal_vip: diff --git a/src/server_mgr_puppet.py b/src/server_mgr_puppet.py index 3dddac21..4ae5c49e 100644 --- a/src/server_mgr_puppet.py +++ b/src/server_mgr_puppet.py @@ -48,14 +48,15 @@ def storage_get_control_network_mask(self, provision_params, #openstack_ip = cluster_params.get("internal_vip", None) cluster_openstack_prov_params = ( cluster_params.get("provision", {})).get("openstack", {}) - configured_external_keystone_ip = cluster_openstack_prov_params.get("keystone_ip", None) + configured_external_keystone_params = cluster_openstack_prov_params.get("keystone", None) + configured_external_keystone_ip = configured_external_keystone_params.get("ip", None) openstack_ip = '' self_ip = server.get("ip_address", "") if configured_external_keystone_ip: openstack_ip = configured_external_keystone_ip elif self_ip in role_ips_dict['openstack']: openstack_ip = self_ip - elif 'openstack' in role_ips_dict: + elif 'openstack' in role_ips_dict and len(role_ips_dict['openstack']): openstack_ip = role_ips_dict['openstack'][0] else: msg = "Openstack role not defined for cluster AND External Openstack not configured in cluster parameters.\n " \