mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Tweak failure condition for field attributes expected to be strings
This commit is contained in:
parent
15070e2af8
commit
38573c55bf
1 changed files with 1 additions and 1 deletions
|
@ -235,7 +235,7 @@ class Base:
|
|||
# and make sure the attribute is of the type it should be
|
||||
value = getattr(self, name)
|
||||
if value is not None:
|
||||
if attribute.isa == 'string' and not isinstance(value, string_types):
|
||||
if attribute.isa == 'string' and isinstance(value, (list, dict)):
|
||||
raise AnsibleParserError("The field '%s' is supposed to be a string type, however the incoming data structure is a %s" % (name, type(value)), obj=self.get_ds())
|
||||
|
||||
def copy(self):
|
||||
|
|
Loading…
Reference in a new issue