def _gerrit_user_to_author(props, username='unknown'):
    """
    Convert Gerrit account properties to Buildbot format

    Take into account missing values
    """
    username = props.get('username', username)
    username = props.get('name', username)
    if 'email' in props:
        username += ' <%(email)s>' % props
    return username
