Using None in a VTYPE_MAYBE_STRING is wrong, because it cannot really
be serialized to a Haskel Nothing, but given that this can (and does)
influence external components already using None, it is turned to a
warning in order not to break the existing behavior.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
if ktype in (constants.VTYPE_STRING, constants.VTYPE_MAYBE_STRING):
if target[key] is None and ktype == constants.VTYPE_MAYBE_STRING:
msg = "'None' is not a valid Maybe value. Use 'VALUE_HS_NOTHING'"
- raise errors.TypeEnforcementError(msg)
+ logging.warning(msg)
elif (target[key] == constants.VALUE_HS_NOTHING
and ktype == constants.VTYPE_MAYBE_STRING):
pass