def _generate_system_config(self, host_id, host_vars_dict):
        """Generate updated system config from the template.

           :param host_vars_dict: dict of variables for the system template to
                                  generate system config dict for each host.
        """
        os_version = self.config_manager.get_os_version()

        tmpl_path = os.path.join(
            os.path.join(self.tmpl_dir, os_version), self.SYS_TMPL_NAME
        )
        if not os.path.exists(tmpl_path):
            err_msg = "Template '%s' does not exists!" % tmpl_path
            logging.error(err_msg)
            raise Exception(err_msg)

        system_config = self.get_config_from_template(tmpl_path,
                                                      host_vars_dict)

        # update package config info to cobbler ksmeta
        if self.pk_installer_config and host_id in self.pk_installer_config:
            pk_config = self.pk_installer_config[host_id]
            ksmeta = system_config.setdefault("ksmeta", {})
            util.merge_dict(ksmeta, pk_config)
            system_config["ksmeta"] = ksmeta

        return system_config
dataset/ETHPy150Open openstack/compass-core/compass/deployment/installers/os_installers/cobbler/cobbler.py/CobblerInstaller._generate_system_config/original