Merge "Add support for configuring password retrieve function"

This commit is contained in:
Jenkins 2017-01-12 14:48:00 +00:00 committed by Gerrit Code Review
commit 736169aad0
8 changed files with 73 additions and 8 deletions

View File

@ -215,6 +215,10 @@ options:
type: boolean
default: False
description: Enable cinder backup panel.
password-retrieve:
type: boolean
default: False
description: Enable "Retrieve password" instance action.
prefer-ipv6:
type: boolean
default: False

View File

@ -195,6 +195,7 @@ class HorizonContext(OSContextGenerator):
"neutron_network_firewall": config("neutron-network-firewall"),
"neutron_network_vpn": config("neutron-network-vpn"),
"cinder_backup": config("cinder-backup"),
"password_retrieve": config("password-retrieve"),
'virtualenv': git_pip_venv_dir(projects_yaml)
if config('openstack-origin-git') else None,
}

View File

@ -521,4 +521,8 @@ COMPRESS_OFFLINE = {{ compress_offline }}
# see https://docs.djangoproject.com/en/dev/ref/settings/.
ALLOWED_HOSTS = '*'
{% if password_retrieve %}
OPENSTACK_ENABLE_PASSWORD_RETRIEVE = True
{% endif %}
{{ settings|join('\n\n') }}

View File

@ -168,6 +168,9 @@ OPENSTACK_KEYSTONE_BACKEND = {
#Setting this to True, will add a new "Retrieve Password" action on instance,
#allowing Admin session password retrieval/decryption.
#OPENSTACK_ENABLE_PASSWORD_RETRIEVE = False
{% if password_retrieve %}
OPENSTACK_ENABLE_PASSWORD_RETRIEVE = True
{% endif %}
# The Xen Hypervisor has the ability to set the mount point for volumes
# attached to instances (other Hypervisors currently do not). Setting

View File

@ -191,6 +191,9 @@ OPENSTACK_KEYSTONE_BACKEND = {
# Setting this to True, will add a new "Retrieve Password" action on instance,
# allowing Admin session password retrieval/decryption.
#OPENSTACK_ENABLE_PASSWORD_RETRIEVE = False
{% if password_retrieve %}
OPENSTACK_ENABLE_PASSWORD_RETRIEVE = True
{% endif %}
# The Launch Instance user experience has been significantly enhanced.
# You can choose whether to enable the new launch instance experience,

View File

@ -256,6 +256,9 @@ OPENSTACK_KEYSTONE_BACKEND = {
# Setting this to True, will add a new "Retrieve Password" action on instance,
# allowing Admin session password retrieval/decryption.
#OPENSTACK_ENABLE_PASSWORD_RETRIEVE = False
{% if password_retrieve %}
OPENSTACK_ENABLE_PASSWORD_RETRIEVE = True
{% endif %}
# The Launch Instance user experience has been significantly enhanced.
# You can choose whether to enable the new launch instance experience,

View File

@ -258,6 +258,9 @@ OPENSTACK_KEYSTONE_BACKEND = {
# Setting this to True, will add a new "Retrieve Password" action on instance,
# allowing Admin session password retrieval/decryption.
#OPENSTACK_ENABLE_PASSWORD_RETRIEVE = False
{% if password_retrieve %}
OPENSTACK_ENABLE_PASSWORD_RETRIEVE = True
{% endif %}
# The Launch Instance user experience has been significantly enhanced.
# You can choose whether to enable the new launch instance experience,

View File

@ -113,7 +113,10 @@ class TestHorizonContexts(CharmTestCase):
"neutron_network_lb": False,
"neutron_network_firewall": False,
"neutron_network_vpn": False,
"cinder_backup": False})
"cinder_backup": False,
"password_retrieve": False,
}
)
def test_HorizonContext_debug(self):
self.test_config.set('debug', 'yes')
@ -130,7 +133,10 @@ class TestHorizonContexts(CharmTestCase):
"neutron_network_lb": False,
"neutron_network_firewall": False,
"neutron_network_vpn": False,
"cinder_backup": False})
"cinder_backup": False,
"password_retrieve": False,
}
)
def test_HorizonContext_ubuntu_theme(self):
self.test_config.set('ubuntu-theme', 'False')
@ -147,7 +153,10 @@ class TestHorizonContexts(CharmTestCase):
"neutron_network_lb": False,
"neutron_network_firewall": False,
"neutron_network_vpn": False,
"cinder_backup": False})
"cinder_backup": False,
"password_retrieve": False,
}
)
def test_HorizonContext_default_theme(self):
self.test_config.set('ubuntu-theme', 'False')
@ -165,7 +174,10 @@ class TestHorizonContexts(CharmTestCase):
"neutron_network_lb": False,
"neutron_network_firewall": False,
"neutron_network_vpn": False,
"cinder_backup": False})
"cinder_backup": False,
"password_retrieve": False,
}
)
def test_HorizonContext_default_theme_true(self):
self.test_config.set('ubuntu-theme', 'true')
@ -186,7 +198,10 @@ class TestHorizonContexts(CharmTestCase):
"neutron_network_lb": False,
"neutron_network_firewall": False,
"neutron_network_vpn": False,
"cinder_backup": False})
"cinder_backup": False,
"password_retrieve": False,
}
)
def test_HorizonContext_role(self):
self.test_config.set('default-role', 'foo')
@ -203,7 +218,10 @@ class TestHorizonContexts(CharmTestCase):
"neutron_network_lb": False,
"neutron_network_firewall": False,
"neutron_network_vpn": False,
"cinder_backup": False})
"cinder_backup": False,
"password_retrieve": False,
}
)
def test_HorizonContext_webroot(self):
self.test_config.set('webroot', '/')
@ -220,7 +238,10 @@ class TestHorizonContexts(CharmTestCase):
"neutron_network_lb": False,
"neutron_network_firewall": False,
"neutron_network_vpn": False,
"cinder_backup": False})
"cinder_backup": False,
"password_retrieve": False,
}
)
def test_HorizonContext_panels(self):
self.test_config.set('neutron-network-dvr', True)
@ -242,7 +263,30 @@ class TestHorizonContexts(CharmTestCase):
"neutron_network_lb": True,
"neutron_network_firewall": True,
"neutron_network_vpn": True,
"cinder_backup": True})
"cinder_backup": True,
"password_retrieve": False,
}
)
def test_HorizonContext_password_retrieve(self):
self.test_config.set('password-retrieve', True)
self.assertEquals(horizon_contexts.HorizonContext()(),
{'compress_offline': True, 'debug': False,
'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": True,
}
)
def test_IdentityServiceContext_not_related(self):
self.relation_ids.return_value = []