def ask(self, components, install=True): for name, value in self._softwares.iteritems(): if self._ask(name, install): if install: value.ask() for comp_name, comp_configs in value.components.iteritems(): scripts = self._get_install_scripts(name, comp_name, install) if os.path.exists(scripts): print 'executing scripts %s' % scripts if not run_command(scripts, redirect_output=False): print "installing failure" for comp_config in comp_configs: if comp_config.install: template_path = self._get_templates_path(name, comp_config.default_value) dump_config(value.config, template_path, comp_config.value)
def ask(self, components, install=True, install_default=True): for name, value in self._softwares.iteritems(): # ask users this software shoule be installed/uninstalled if components or self._ask(name, install): # if install stage, query config item if install: value.ask(components, install_default) for comp_name, comp_configs in value.components.iteritems(): if not components or comp_name in components: self._run_install(name, comp_name, install) for comp_config in comp_configs: if comp_config.install: template_path = self._get_templates_path(name, comp_config.default_value) dump_config(value.config, template_path, comp_config.value) self._save_installed_templates(name, comp_name, comp_config.value) self._run_install(name, comp_name, install, True)
def ask(self, components, install=True): for name, value in self._softwares.iteritems(): if self._ask(name, install): if install: value.ask() for comp_name, comp_configs in value.components.iteritems(): scripts = self._get_install_scripts( name, comp_name, install) if os.path.exists(scripts): print 'executing scripts %s' % scripts if not run_command(scripts, redirect_output=False): print "installing failure" for comp_config in comp_configs: if comp_config.install: template_path = self._get_templates_path( name, comp_config.default_value) dump_config(value.config, template_path, comp_config.value)