Merge "Add disable-instance-snapshot config item"

This commit is contained in:
Zuul 2020-01-16 13:55:39 +00:00 committed by Gerrit Code Review
commit 8ec35986df
5 changed files with 38 additions and 2 deletions

View File

@ -175,6 +175,14 @@ options:
type: string
default:
description: Default profile for the dashboard. Eg. cisco.
disable-instance-snapshot:
type: boolean
default: False
description: |
This setting disables Snapshots as a valid boot source for launching
instances. Snapshots sources wont show up in the Launch Instance modal
dialogue box. This option works from the Newton release, and has no
effect on earlier OpenStack releases.
neutron-network-dvr:
type: boolean
default: False

View File

@ -207,6 +207,8 @@ class HorizonContext(OSContextGenerator):
'session_timeout': config('session-timeout'),
'dropdown_max_items': config('dropdown-max-items'),
'enable_consistency_groups': config('enable-consistency-groups'),
'disable_instance_snapshot': bool(
config('disable-instance-snapshot'))
}
return ctxt

View File

@ -297,6 +297,10 @@ OPENSTACK_ENABLE_PASSWORD_RETRIEVE = True
# 'disable_volume': False,
# 'disable_volume_snapshot': False,
#}
LAUNCH_INSTANCE_DEFAULTS = {
'disable_instance_snapshot': {{ disable_instance_snapshot }},
}
# The Xen Hypervisor has the ability to set the mount point for volumes
# attached to instances (other Hypervisors currently do not). Setting

View File

@ -299,7 +299,8 @@ OPENSTACK_ENABLE_PASSWORD_RETRIEVE = True
# 'create_volume': True,
#}
LAUNCH_INSTANCE_DEFAULTS = {
'create_volume': {{ default_create_volume }}
'create_volume': {{ default_create_volume }},
'disable_instance_snapshot': {{ disable_instance_snapshot }},
}
# The Xen Hypervisor has the ability to set the mount point for volumes

View File

@ -123,6 +123,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -154,6 +155,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -185,6 +187,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -216,6 +219,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -248,6 +252,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -283,6 +288,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -314,6 +320,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -345,6 +352,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -381,6 +389,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -412,6 +421,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -443,10 +453,11 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
def test_HorizonContext_password_autocompletion(self):
def test_HorizonContex_password_autocompletion(self):
self.maxDiff = 900
self.test_config.set('allow-password-autocompletion', True)
self.assertEqual(horizon_contexts.HorizonContext()(),
@ -475,6 +486,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -507,6 +519,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -539,6 +552,7 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
@ -571,9 +585,16 @@ class TestHorizonContexts(CharmTestCase):
"session_timeout": 3600,
"dropdown_max_items": 30,
"enable_consistency_groups": False,
"disable_instance_snapshot": False,
}
)
def test_HorizonContext_can_set_disable_instance_snapshot(self):
self.maxDiff = 900
self.test_config.set('disable-instance-snapshot', True)
self.assertTrue(horizon_contexts
.HorizonContext()()['disable_instance_snapshot'])
def test_IdentityServiceContext_not_related(self):
self.relation_ids.return_value = []
self.context_complete.return_value = False