Skip to content
Snippets Groups Projects
Commit 8593909b authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "Fix service_mapped_to_host filter"

parents e03f06c0 35966c91
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("groups")
return group in context.get("group_names")
raise exception.FilterError(
"Service definition for '%s' does not have a 'group' or "
......
......@@ -104,14 +104,14 @@ class TestFilters(unittest.TestCase):
service = {
'group': 'foo'
}
context = self._make_context({'groups': ['foo', 'bar']})
context = self._make_context({'group_names': ['foo', 'bar']})
self.assertTrue(filters.service_mapped_to_host(context, service))
def test_service_mapped_to_host_not_in_group(self):
service = {
'group': 'foo'
}
context = self._make_context({'groups': ['bar']})
context = self._make_context({'group_names': ['bar']})
self.assertFalse(filters.service_mapped_to_host(context, service))
def test_service_mapped_to_host_no_attr(self):
......
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