From 51645eab599b0b23c582e22a9e84ce9423362ab1 Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Mon, 21 Aug 2017 14:27:19 +0200 Subject: Update error message: s/non-unique/duplicate --- .../action_plugins/openshift_health_check.py | 8 +++----- roles/openshift_health_checker/test/action_plugin_test.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'roles') diff --git a/roles/openshift_health_checker/action_plugins/openshift_health_check.py b/roles/openshift_health_checker/action_plugins/openshift_health_check.py index f80a53030..8d35db6b5 100644 --- a/roles/openshift_health_checker/action_plugins/openshift_health_check.py +++ b/roles/openshift_health_checker/action_plugins/openshift_health_check.py @@ -86,12 +86,10 @@ class ActionModule(ActionBase): name = cls.name if name in known_checks: other_cls = known_checks[name].__class__ - msg = "non-unique check name '{}' in: '{}' and '{}'".format( - name, - full_class_name(cls), - full_class_name(other_cls), + raise OpenShiftCheckException( + "duplicate check name '{}' in: '{}' and '{}'" + "".format(name, full_class_name(cls), full_class_name(other_cls)) ) - raise OpenShiftCheckException(msg) known_checks[name] = cls(execute_module=self._execute_module, tmp=tmp, task_vars=task_vars) return known_checks diff --git a/roles/openshift_health_checker/test/action_plugin_test.py b/roles/openshift_health_checker/test/action_plugin_test.py index 2274cbd21..c109ebd24 100644 --- a/roles/openshift_health_checker/test/action_plugin_test.py +++ b/roles/openshift_health_checker/test/action_plugin_test.py @@ -95,7 +95,7 @@ def test_action_plugin_cannot_load_checks_with_the_same_name(plugin, task_vars, result = plugin.run(tmp=None, task_vars=task_vars) - assert failed(result, msg_has=['unique', 'duplicate_name', 'FakeCheck']) + assert failed(result, msg_has=['duplicate', 'duplicate_name', 'FakeCheck']) def test_action_plugin_skip_non_active_checks(plugin, task_vars, monkeypatch): -- cgit v1.2.3