Allow to override the default volume creation behavior
Now that Horizon upstream added the ability to configure the default "create volume" value when launching an instance (See. LP: #1678109), expose it as a new charm config. Change-Id: I68a6f199a72c11ad4eff2b587cb4279c91da52ae Closes-Bug: #1711342
This commit is contained in:
parent
5e0f9e508b
commit
55b9667193
|
@ -342,3 +342,11 @@ options:
|
|||
default: False
|
||||
description: |
|
||||
Setting this to True will allow password form autocompletion by browser.
|
||||
default-create-volume:
|
||||
type: boolean
|
||||
default: True
|
||||
description: |
|
||||
The default value for the option of creating a new volume in the
|
||||
workflow for image and instance snapshot sources when launching an
|
||||
instance. This option has an effect only to Ocata or newer
|
||||
releases.
|
||||
|
|
|
@ -202,7 +202,8 @@ class HorizonContext(OSContextGenerator):
|
|||
'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
|
||||
'multi_domain': False if config('default-domain') else True,
|
||||
"default_create_volume": config("default-create-volume"),
|
||||
}
|
||||
|
||||
return ctxt
|
||||
|
|
|
@ -288,12 +288,16 @@ OPENSTACK_ENABLE_PASSWORD_RETRIEVE = True
|
|||
# properties found in the Launch Instance modal.
|
||||
#LAUNCH_INSTANCE_DEFAULTS = {
|
||||
# 'config_drive': False,
|
||||
# 'enable_scheduler_hints': True
|
||||
# 'enable_scheduler_hints': True,
|
||||
# 'disable_image': False,
|
||||
# 'disable_instance_snapshot': False,
|
||||
# 'disable_volume': False,
|
||||
# 'disable_volume_snapshot': False,
|
||||
# 'create_volume': True,
|
||||
#}
|
||||
LAUNCH_INSTANCE_DEFAULTS = {
|
||||
'create_volume': {{ default_create_volume }}
|
||||
}
|
||||
|
||||
# The Xen Hypervisor has the ability to set the mount point for volumes
|
||||
# attached to instances (other Hypervisors currently do not). Setting
|
||||
|
|
|
@ -138,6 +138,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -162,6 +163,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": "example_domain",
|
||||
"multi_domain": False,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -186,6 +188,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -210,6 +213,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -235,6 +239,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -263,6 +268,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -287,6 +293,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -311,6 +318,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -340,6 +348,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -364,6 +373,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -388,6 +398,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -412,6 +423,32 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"default_domain": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": True,
|
||||
"default_create_volume": True,
|
||||
}
|
||||
)
|
||||
|
||||
def test_HorizonContext_default_create_volume(self):
|
||||
self.test_config.set('default-create-volume', False)
|
||||
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": None,
|
||||
"multi_domain": True,
|
||||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": False,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue