mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
Do not use str() on exceptions (#46950)
This commit is contained in:
parent
2436aa1a4e
commit
a80c25cbd9
30 changed files with 76 additions and 66 deletions
|
@ -22,6 +22,7 @@ __metaclass__ = type
|
|||
import os
|
||||
|
||||
from ansible.errors import AnsibleParserError, AnsibleError
|
||||
from ansible.module_utils._text import to_native
|
||||
from ansible.module_utils.six import iteritems, string_types
|
||||
from ansible.playbook.attribute import Attribute, FieldAttribute
|
||||
from ansible.playbook.base import Base
|
||||
|
@ -80,7 +81,7 @@ class RoleMetadata(Base):
|
|||
role_def['name'] = def_parsed['name']
|
||||
roles.append(role_def)
|
||||
except AnsibleError as exc:
|
||||
raise AnsibleParserError(str(exc), obj=role_def, orig_exc=exc)
|
||||
raise AnsibleParserError(to_native(exc), obj=role_def, orig_exc=exc)
|
||||
|
||||
current_role_path = None
|
||||
if self._owner:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue