Add special handling for the case where a string is passed instead of a
list. Without this fix a string will be converted into a list of single
letter items, something pretty much no one ever wants. Raise an
exception instead.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit
e760668778ddc8227d0c3aa7baa10ec39bb0b885)
return _fs(value)
if fld.takes(list):
+ if isinstance(value, str):
+ raise ResourceTypeError(
+ f'{fld.name} expects a list not a string'
+ )
subtype = fld.list_element_type()
return [
self._object_sub_from_simplified(subtype, v) for v in value