Merge "Add default_domain config option."
This commit is contained in:
commit
34fb0be877
|
@ -79,6 +79,12 @@ options:
|
|||
description: |
|
||||
Default role for Horizon operations that will be created in
|
||||
Keystone upon introduction of an identity-service relation.
|
||||
default-domain:
|
||||
type: string
|
||||
default:
|
||||
description: |
|
||||
Default domain when authenticating with Horizon. Disables the domain
|
||||
field in the login page.
|
||||
dns-ha:
|
||||
type: boolean
|
||||
default: False
|
||||
|
|
|
@ -135,8 +135,9 @@ class IdentityServiceContext(OSContextGenerator):
|
|||
# If using keystone v3 the context is incomplete without the
|
||||
# admin domain id
|
||||
if local_ctxt['api_version'] == '3':
|
||||
local_ctxt['admin_domain_id'] = rdata.get(
|
||||
'admin_domain_id')
|
||||
if not config('default_domain'):
|
||||
local_ctxt['admin_domain_id'] = rdata.get(
|
||||
'admin_domain_id')
|
||||
if not context_complete(local_ctxt):
|
||||
continue
|
||||
|
||||
|
@ -198,6 +199,8 @@ class HorizonContext(OSContextGenerator):
|
|||
"password_retrieve": config("password-retrieve"),
|
||||
'virtualenv': git_pip_venv_dir(projects_yaml)
|
||||
if config('openstack-origin-git') else None,
|
||||
'default_domain': config('default-domain'),
|
||||
'multi_domain': False if config('default-domain') else True
|
||||
}
|
||||
|
||||
return ctxt
|
||||
|
|
|
@ -198,8 +198,8 @@ OPENSTACK_KEYSTONE_DEFAULT_ROLE = "{{ default_role }}"
|
|||
{% if api_version == "3" -%}
|
||||
OPENSTACK_KEYSTONE_URL = "{{ service_protocol }}://%s:{{ service_port }}/v3" % OPENSTACK_HOST
|
||||
OPENSTACK_API_VERSIONS = { "identity": 3, }
|
||||
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
|
||||
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "{{ admin_domain_id }}"
|
||||
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = "{{ multi_domain }}"
|
||||
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "{{ default_domain or admin_domain_id }}"
|
||||
{% else -%}
|
||||
OPENSTACK_KEYSTONE_URL = "{{ service_protocol }}://%s:{{ service_port }}/v2.0" % OPENSTACK_HOST
|
||||
{% endif -%}
|
||||
|
|
|
@ -198,8 +198,8 @@ OPENSTACK_KEYSTONE_DEFAULT_ROLE = "{{ default_role }}"
|
|||
{% if api_version == "3" -%}
|
||||
OPENSTACK_KEYSTONE_URL = "{{ service_protocol }}://%s:{{ service_port }}/v3" % OPENSTACK_HOST
|
||||
OPENSTACK_API_VERSIONS = { "identity": 3, }
|
||||
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
|
||||
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "{{ admin_domain_id }}"
|
||||
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = "{{ multi_domain }}"
|
||||
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "{{ default_domain or admin_domain_id }}"
|
||||
{% else -%}
|
||||
OPENSTACK_KEYSTONE_URL = "{{ service_protocol }}://%s:{{ service_port }}/v2.0" % OPENSTACK_HOST
|
||||
{% endif -%}
|
||||
|
|
|
@ -198,8 +198,8 @@ OPENSTACK_KEYSTONE_DEFAULT_ROLE = "{{ default_role }}"
|
|||
{% if api_version == "3" -%}
|
||||
OPENSTACK_KEYSTONE_URL = "{{ service_protocol }}://%s:{{ service_port }}/v3" % OPENSTACK_HOST
|
||||
OPENSTACK_API_VERSIONS = { "identity": 3, }
|
||||
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
|
||||
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "{{ admin_domain_id }}"
|
||||
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = "{{ multi_domain }}"
|
||||
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "{{ default_domain or admin_domain_id }}"
|
||||
{% else -%}
|
||||
OPENSTACK_KEYSTONE_URL = "{{ service_protocol }}://%s:{{ service_port }}/v2.0" % OPENSTACK_HOST
|
||||
{% endif -%}
|
||||
|
|
|
@ -123,6 +123,31 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"neutron_network_vpn": False,
|
||||
"cinder_backup": False,
|
||||
"password_retrieve": False,
|
||||
"default_domain": None,
|
||||
"multi_domain": True
|
||||
}
|
||||
)
|
||||
|
||||
def test_HorizonContext_default_domain(self):
|
||||
self.test_config.set('default-domain', 'example_domain')
|
||||
self.assertEqual(horizon_contexts.HorizonContext()(),
|
||||
{'compress_offline': True, 'debug': False,
|
||||
'customization_module': '',
|
||||
'default_role': 'Member', 'webroot': '/horizon',
|
||||
'ubuntu_theme': True,
|
||||
'default_theme': None,
|
||||
'virtualenv': None,
|
||||
'secret': 'secret',
|
||||
'support_profile': None,
|
||||
"neutron_network_dvr": False,
|
||||
"neutron_network_l3ha": False,
|
||||
"neutron_network_lb": False,
|
||||
"neutron_network_firewall": False,
|
||||
"neutron_network_vpn": False,
|
||||
"cinder_backup": False,
|
||||
"password_retrieve": False,
|
||||
"default_domain": "example_domain",
|
||||
"multi_domain": False
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -144,6 +169,8 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"neutron_network_vpn": False,
|
||||
"cinder_backup": False,
|
||||
"password_retrieve": False,
|
||||
"default_domain": None,
|
||||
"multi_domain": True
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -165,6 +192,8 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"neutron_network_vpn": False,
|
||||
"cinder_backup": False,
|
||||
"password_retrieve": False,
|
||||
"default_domain": None,
|
||||
"multi_domain": True
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -187,6 +216,8 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"neutron_network_vpn": False,
|
||||
"cinder_backup": False,
|
||||
"password_retrieve": False,
|
||||
"default_domain": None,
|
||||
"multi_domain": True
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -212,6 +243,8 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"neutron_network_vpn": False,
|
||||
"cinder_backup": False,
|
||||
"password_retrieve": False,
|
||||
"default_domain": None,
|
||||
"multi_domain": True
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -233,6 +266,8 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"neutron_network_vpn": False,
|
||||
"cinder_backup": False,
|
||||
"password_retrieve": False,
|
||||
"default_domain": None,
|
||||
"multi_domain": True
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -254,6 +289,8 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"neutron_network_vpn": False,
|
||||
"cinder_backup": False,
|
||||
"password_retrieve": False,
|
||||
"default_domain": None,
|
||||
"multi_domain": True
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -280,6 +317,8 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"neutron_network_vpn": True,
|
||||
"cinder_backup": True,
|
||||
"password_retrieve": False,
|
||||
"default_domain": None,
|
||||
"multi_domain": True
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -301,6 +340,8 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"neutron_network_vpn": False,
|
||||
"cinder_backup": False,
|
||||
"password_retrieve": True,
|
||||
"default_domain": None,
|
||||
"multi_domain": True
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -322,6 +363,8 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"neutron_network_vpn": False,
|
||||
"cinder_backup": False,
|
||||
"password_retrieve": False,
|
||||
"default_domain": None,
|
||||
"multi_domain": True
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue