From 28e069f1700ced1203b6953f75f4ece5298375df Mon Sep 17 00:00:00 2001 From: Daniel Bengtsson Date: Wed, 24 Feb 2021 21:23:49 +0100 Subject: [PATCH] Remove the condition to check the groups. The code of the groups property in the Validation class changed. Before the code didn't check if the key groups was there. You can see the change[1] to have more information. [1] https://opendev.org/openstack/validations-libs/commit/eb62054a336853c3ea641d781a8b577abf407fca Closes-bug: #1917785 Co-authored-by: Owen McGonagle Change-Id: Ib11fd1b829bd56c19f82081d53440b4dd8237f3f --- validations_libs/tests/test_utils.py | 10 ---------- validations_libs/utils.py | 3 --- 2 files changed, 13 deletions(-) diff --git a/validations_libs/tests/test_utils.py b/validations_libs/tests/test_utils.py index 86e6d7f3..655c602f 100644 --- a/validations_libs/tests/test_utils.py +++ b/validations_libs/tests/test_utils.py @@ -223,13 +223,3 @@ class TestUtils(TestCase): self.assertRaises(TypeError, utils.convert_data, data=data_dict) - - @mock.patch('yaml.safe_load', return_value=fakes.FAKE_PLAYBOOK3) - @mock.patch('six.moves.builtins.open') - @mock.patch('glob.glob') - def test_playbook_without_groups(self, mock_glob, mock_open, mock_load): - mock_glob.return_value = \ - ['/foo/playbook/foo.yaml'] - self.assertRaises(RuntimeError, - utils.parse_all_validations_on_disk, - "/foo/playbook") diff --git a/validations_libs/utils.py b/validations_libs/utils.py index 0d45188d..cd74727c 100644 --- a/validations_libs/utils.py +++ b/validations_libs/utils.py @@ -88,9 +88,6 @@ def parse_all_validations_on_disk(path, groups=None): for pl in validations_abspath: val = Validation(pl) - if not val.groups: - msg = 'Group not found in playbook - please add appropriate group' - raise RuntimeError(msg) if not groups or set(groups).intersection(val.groups): results.append(val.get_metadata)