Merge "Allow jobs to disable all services"

This commit is contained in:
Zuul 2017-12-14 06:54:24 +00:00 committed by Gerrit Code Review
commit f4cec2d9b5
2 changed files with 9 additions and 1 deletions

View File

@ -53,7 +53,12 @@ Write the local.conf file for use by devstack
A dictionary mapping service names to boolean values. If the
boolean value is ``false``, a ``disable_service`` line will be
emitted for the service name. If it is ``true``, then
``enable_service`` will be emitted. All other values are ignored.
``enable_service`` will be emitted. All other values are ignored.
The special key ``base`` can be used to enable or disable the base set of
services enabled by default. If ``base`` is found, it will processed before
all other keys. If its value is ``False`` a ``disable_all_services`` will be
emitted; if its value is ``True`` nothing will be emitted since base
services are enabled by default.
.. zuul:rolevar:: devstack_plugins
:type: dict

View File

@ -124,6 +124,9 @@ class LocalConf(object):
self.localrc.append('enable_plugin {} {}'.format(k, v))
def handle_services(self, services):
base_services = services.pop('base', True)
if not base_services:
self.localrc.append('disable_all_services')
for k, v in services.items():
if v is False:
self.localrc.append('disable_service {}'.format(k))