def _rebuild_xvp_conf(self, context): logging.debug(_("Rebuilding xvp conf")) pools = [pool for pool in db.console_pool_get_all_by_host_type(context, self.host, self.console_type) if pool['consoles']] if not pools: logging.debug("No console pools!") self._xvp_stop() return conf_data = {'multiplex_port': FLAGS.console_xvp_multiplex_port, 'pools': pools, 'pass_encode': self.fix_console_password} config = str(Template(self.xvpconf_template, searchList=[conf_data])) self._write_conf(config) self._xvp_restart()
def _rebuild_xvp_conf(self, context): LOG.debug(_('Rebuilding xvp conf')) pools = [pool for pool in db.console_pool_get_all_by_host_type(context, self.host, self.console_type) if pool['consoles']] if not pools: LOG.debug('No console pools!') self._xvp_stop() return conf_data = {'multiplex_port': FLAGS.console_xvp_multiplex_port, 'pools': pools, 'pass_encode': self.fix_console_password} config = str(Template.Template(self.xvpconf_template, searchList=[conf_data])) self._write_conf(config) self._xvp_restart()
def _rebuild_xvp_conf(self, context): LOG.debug('Rebuilding xvp conf') pools = [pool for pool in db.console_pool_get_all_by_host_type(context, self.host, self.console_type) if pool['consoles']] if not pools: LOG.debug('No console pools!') self._xvp_stop() return conf_data = {'multiplex_port': CONF.console_xvp_multiplex_port, 'pools': pools} tmpl_path, tmpl_file = os.path.split(CONF.injected_network_template) env = jinja2.Environment(loader=jinja2.FileSystemLoader(tmpl_path)) env.filters['pass_encode'] = self.fix_console_password template = env.get_template(tmpl_file) self._write_conf(template.render(conf_data)) self._xvp_restart()