Skip to content
Snippets Groups Projects
Commit 8cc58e36 authored by Mark Goddard's avatar Mark Goddard
Browse files

Fix service_mapped_to_host filter for common services

In Ibecac60d1417269bbe25a280996ca9de6e6d018f, the services in the common
role were marked as being mapped to the 'all' group, since the
'service_mapped_to_host' filter expects every service definition to have
either a 'group' or 'host_in_groups' field. While this allows the filter
to pass the common services without error, it will not actually show
them as being mapped to any hosts. This is because the filter uses the
'group_names' variable, which contains all of the groups that a host
belongs to, except the default 'all' group.

This change fixes the issue by returning True from
service_mapped_to_host when the service's group is 'all'.

Change-Id: I39c8416f5d30a535c1743f9c43434b7d2a382196
Related-Bug: #1868596
parent 2d8edc37
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,7 @@ def service_mapped_to_host(context, service):
group = service.get("group")
if group is not None:
return group in context.get("group_names")
return group in context.get("group_names") or group == "all"
raise exception.FilterError(
"Service definition for '%s' does not have a 'group' or "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment