def METHOD_NAME(tree, path, plugins_options):
    for plugin, plugin_options in plugins_options.items():
        # don't touch the configuration file if there is nothing to do
        if not plugin_options:
            continue
        plugin_conf_path = f"{tree}/etc/{path}/{plugin}.conf"
        plugin_conf = iniparse.SafeConfigParser()
        try:
            with open(plugin_conf_path, "r", encoding="utf8") as f:
                plugin_conf.readfp(f)
        except FileNotFoundError:
            print(f"Error: {plugin} configuration file '{plugin_conf_path}' does not exist.")
            return 1
        for option, value in plugin_options.items():
            # defined by the "enabled" boolean option in the "main" section
            if option == "enabled":
                if not plugin_conf.has_section("main"):
                    plugin_conf.add_section("main")
                # rhsm plugins tend to use 0/1 for boolean values
                plugin_conf.set("main", "enabled", str(int(value)))
            else:
                # schema does not allow any additional properties, but keeping this for completeness
                print(f"Error: unknown property {option} specified for {plugin} plugin.")
                return 1
        with open(plugin_conf_path, "w", encoding="utf8") as f:
            plugin_conf.write(f)
    return 0