def check_snail_conf(self): snail_conf = "%s/snail.conf" % common.get_home() if not common.check_file(snail_conf): LOG.error("Could not locate snail.conf") self.abort() snail_config = ConfigParser.ConfigParser() snail_config.readfp(open(snail_conf)) if not snail_config.has_section("snail"): LOG.error("snail.conf is missing snail section") common.exit(1) if not snail_config.has_option("snail", "inova_repo"): LOG.error("snail.conf is missing inova_repo option") common.exit(1) if not snail_config.has_option("snail", "template_repo"): LOG.error("snail.conf is missing template_repo option") common.exit(1) if not snail_config.has_option("snail", "inova_user"): LOG.error("snail.conf is missing inova_user option") common.exit(1) self.inova_repo = snail_config.get("snail", "inova_repo") self.template_repo = snail_config.get("snail", "template_repo") self.inova_user = snail_config.get("snail", "inova_user")
def run(self, reinstall=False, refresh_conf=False, overwrite=False): if self.uninstall: LOG.info("Uninstalling snail _@/") if not common.check_dir(self.install_path): LOG.error("Not installed. Not that bad really.") common.exit(1) common.remove_dir(self.install_path) common.exit(0) LOG.info("Installing snail _@/") if not common.check_basics(require_super=False, require_venv=False): common.exit(1) self.check_snail_conf() if not self.backup_existing_supernova_conf(overwrite=overwrite): exit(1) if not self.backup_existing_inova_conf(overwrite=overwrite): exit(1) if not refresh_conf: LOG.info("Starting install") self.install(reinstall) LOG.info("Finished install") LOG.info("Generating supernova and inova conf") self.generate_supernova_conf() LOG.info("Finished generating supernova and inova conf") LOG.info("Configuring keyrings") if not self.configure_keyring(): if not DEBUG: self.abort() LOG.info("Done configuring keyrings") self.confirm_inovas()
def abort(self): common.remove_dir(self.install_path) common.exit(1)