diff options
| author | Mark Goddard <mark@stackhpc.com> | 2020-03-20 17:03:14 +0000 |
|---|---|---|
| committer | Mark Goddard <mark@stackhpc.com> | 2020-03-20 17:03:14 +0000 |
| commit | 35966c9186d868948a037bae7c58ac6e6279a4f0 (patch) | |
| tree | 08ab5865ce7b7c6dbd18f5c2e17a561e50996452 /kolla_ansible/tests | |
| parent | 9643dd54e26760d6249eed2ecb2712da28b05882 (diff) | |
| download | kolla-ansible-35966c9186d868948a037bae7c58ac6e6279a4f0.tar.gz kolla-ansible-35966c9186d868948a037bae7c58ac6e6279a4f0.zip | |
Fix service_mapped_to_host filter
The service_mapped_to_host filter is used to check if a service is
mapped to a host, based on the group for the service or its
host_in_groups attribute if one exists. We check if the service's group
is in the 'groups' list. However, to get the list of groups to which a
host belongs, we should use the 'group_names' list.
This filter is currently only used in neutron IPv6 module loading, so
the effects are minimal.
Change-Id: I37409ca8d273b0426df0a648db222dc5432e738a
Closes-Bug: #1868285
Diffstat (limited to 'kolla_ansible/tests')
| -rw-r--r-- | kolla_ansible/tests/unit/test_filters.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kolla_ansible/tests/unit/test_filters.py b/kolla_ansible/tests/unit/test_filters.py index c3314ae8c..8eef4f0e0 100644 --- a/kolla_ansible/tests/unit/test_filters.py +++ b/kolla_ansible/tests/unit/test_filters.py @@ -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): |
