Skip to content
Snippets Groups Projects
Commit 9663d5f9 authored by ale's avatar ale
Browse files

Add a disabled: true attribute to services

All the attribute does right now is, it will skip host allocation for
the service.
parent caf29091
No related tags found
No related merge requests found
......@@ -522,7 +522,9 @@ class Assignments(object):
service = services[service_name]
available_hosts = cls._available_hosts(service, group_map)
num_instances = service.get('num_instances', 'all')
if num_instances == 'all':
if service.get('disabled'):
service_hosts = []
elif num_instances == 'all':
service_hosts = sorted(available_hosts)
else:
service_hosts = sorted(_binpack(
......@@ -530,7 +532,7 @@ class Assignments(object):
service_hosts_map[service_name] = service_hosts
for h in service_hosts:
host_occupation[h] += 1
if service.get('master_election'):
if service.get('master_election') and not service.get('disabled'):
if 'master_scheduling_group' in service:
available_hosts = set(available_hosts).intersection(
set(group_map[service['master_scheduling_group']]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment