Revision 59525e1f lib/utils.py

b/lib/utils.py
786 786
      msg = "'%s' has non-enforceable type %s" % (key, ktype)
787 787
      raise errors.ProgrammerError(msg)
788 788

  
789
    if ktype == constants.VTYPE_STRING:
790
      if not isinstance(target[key], basestring):
789
    if ktype in (constants.VTYPE_STRING, constants.VTYPE_MAYBE_STRING):
790
      if target[key] is None and ktype == constants.VTYPE_MAYBE_STRING:
791
        pass
792
      elif not isinstance(target[key], basestring):
791 793
        if isinstance(target[key], bool) and not target[key]:
792 794
          target[key] = ''
793 795
        else:

Also available in: Unified diff