Iter over a config and raise if a required option is still not set.

    Args:
        config (confpy.core.config.Configuration): The configuration object
            to validate.

    Raises:
        MissingRequiredOption: If any required options are not set in the
            configuration object.

    Required options with default values are considered set and will not cause
    this function to raise.

def check_for_missing_options(config):
    """Iter over a config and raise if a required option is still not set.

    Args:
        config (confpy.core.config.Configuration): The configuration object
            to validate.

    Raises:
        MissingRequiredOption: If any required options are not set in the
            configuration object.

    Required options with default values are considered set and will not cause
    this function to raise.
    """
    for section_name, section in config:

        for option_name, option in section:

            if option.required and option.value is None:

                raise exc.MissingRequiredOption(
                    "Option {0} in namespace {1} is required.".format(
                        option_name,
                        section_name,
                    )
                )

    return config