1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Correct the AnsibleError exception to call its superclass's constructor

This commit is contained in:
Toshio Kuratomi 2017-12-21 19:46:15 -08:00
parent 235bdfb996
commit 5a80375be9
2 changed files with 2 additions and 1 deletions

View file

@ -51,6 +51,8 @@ class AnsibleError(Exception):
''' '''
def __init__(self, message="", obj=None, show_content=True, suppress_extended_error=False, orig_exc=None): def __init__(self, message="", obj=None, show_content=True, suppress_extended_error=False, orig_exc=None):
super(AnsibleError, self).__init__(message)
# we import this here to prevent an import loop problem, # we import this here to prevent an import loop problem,
# since the objects code also imports ansible.errors # since the objects code also imports ansible.errors
from ansible.parsing.yaml.objects import AnsibleBaseYAMLObject from ansible.parsing.yaml.objects import AnsibleBaseYAMLObject

View file

@ -125,4 +125,3 @@ class TestModArgsDwim:
assert err.value.args[0].startswith("conflicting action statements: ") assert err.value.args[0].startswith("conflicting action statements: ")
conflicts = set(err.value.args[0][len("conflicting action statements: "):].split(', ')) conflicts = set(err.value.args[0][len("conflicting action statements: "):].split(', '))
assert conflicts == set(('ping', 'shell')) assert conflicts == set(('ping', 'shell'))