def param_to_secopt(param):
    """Convert a parameter name to INI section and option.
    Split on the first dot. If not dot exists, return name
    as option, and None for section."""
    sep = '.'
    sep_loc = param.find(sep)
    if sep_loc == -1:
        # no dot in name, skip it
        section = None
        option = param
    else:
        section = param[0:sep_loc]
        option = param[sep_loc+1:]
    return (section, option)