def main(): opts = parse_options(sys.argv[1:]) global LOGDIR if opts.dry_run: LOGDIR = ".subiquity" LOGFILE = setup_logger(dir=LOGDIR) logger = logging.getLogger('console_conf') logger.info("Starting console-conf v{}".format(VERSION)) logger.info("Arguments passed: {}".format(sys.argv)) signal.signal(signal.SIGINT, signal.SIG_IGN) signal.signal(signal.SIGQUIT, signal.SIG_IGN) env_ok = environment_check(ENVIRONMENT) if env_ok is False and not opts.dry_run: print('Failed environment check. ' 'Check {} for errors.'.format(LOGFILE)) return 1 ui = SubiquityUI() try: interface = ConsoleConf(ui, opts) except ApplicationError as e: logger.exception('Failed to load ConsoleConf interface') print(e) return 1 interface.run()
def main(): opts = parse_options(sys.argv[1:]) global LOGDIR if opts.dry_run: LOGDIR = ".subiquity" LOGFILE = setup_logger(dir=LOGDIR) logger = logging.getLogger('subiquity') logger.info("Starting SUbiquity v{}".format(VERSION)) logger.info("Arguments passed: {}".format(sys.argv)) signal.signal(signal.SIGINT, signal.SIG_IGN) signal.signal(signal.SIGQUIT, signal.SIG_IGN) env_ok = environment_check(ENVIRONMENT) if env_ok is False and not opts.dry_run: print('Failed environment check. ' 'Check {} for errors.'.format(LOGFILE)) return 1 if opts.answers is None and os.path.exists(AUTO_ANSWERS_FILE): logger.debug("Autoloading answers from %s", AUTO_ANSWERS_FILE) opts.answers = AUTO_ANSWERS_FILE ui = SubiquityUI() try: subiquity_interface = Subiquity(ui, opts) except ApplicationError as e: logger.exception('Failed to load Subiquity interface') print(e) return 1 subiquity_interface.run()
def main(): opts = parse_options(sys.argv[1:]) global LOGDIR if opts.dry_run: LOGDIR = ".subiquity" if opts.snaps_from_examples is None: opts.snaps_from_examples = True LOGFILE = setup_logger(dir=LOGDIR) logger = logging.getLogger('subiquity') logger.info("Starting SUbiquity v{}".format(VERSION)) logger.info("Arguments passed: {}".format(sys.argv)) block_log_dir = os.path.join(LOGDIR, "block") os.makedirs(block_log_dir, exist_ok=True) handler = logging.FileHandler(os.path.join(block_log_dir, 'discover.log')) handler.setLevel('DEBUG') handler.setFormatter( logging.Formatter("%(asctime)s %(name)s:%(lineno)d %(message)s")) logging.getLogger('probert').addHandler(handler) handler.addFilter(lambda rec: rec.name != 'probert.network') logging.getLogger('curtin').addHandler(handler) logging.getLogger('block-discover').addHandler(handler) signal.signal(signal.SIGINT, signal.SIG_IGN) signal.signal(signal.SIGQUIT, signal.SIG_IGN) env_ok = environment_check(ENVIRONMENT) if env_ok is False and not opts.dry_run: print('Failed environment check. ' 'Check {} for errors.'.format(LOGFILE)) return 1 if opts.answers is None and os.path.exists(AUTO_ANSWERS_FILE): logger.debug("Autoloading answers from %s", AUTO_ANSWERS_FILE) opts.answers = AUTO_ANSWERS_FILE if opts.answers: opts.answers = open(opts.answers) try: fcntl.flock(opts.answers, fcntl.LOCK_EX | fcntl.LOCK_NB) except OSError: logger.exception( 'Failed to lock auto answers file, proceding without it.') opts.answers.close() opts.answers = None ui = SubiquityUI() try: subiquity_interface = Subiquity(ui, opts, block_log_dir) except ApplicationError as e: logger.exception('Failed to load Subiquity interface') print(e) return 1 subiquity_interface.run()
def main(): opts = parse_options(sys.argv[1:]) global LOGDIR if opts.dry_run: LOGDIR = ".subiquity" if opts.snaps_from_examples is None: opts.snaps_from_examples = True LOGFILE = setup_logger(dir=LOGDIR) logger = logging.getLogger('subiquity') logger.info("Starting SUbiquity v{}".format(VERSION)) logger.info("Arguments passed: {}".format(sys.argv)) signal.signal(signal.SIGINT, signal.SIG_IGN) signal.signal(signal.SIGQUIT, signal.SIG_IGN) env_ok = environment_check(ENVIRONMENT) if env_ok is False and not opts.dry_run: print('Failed environment check. ' 'Check {} for errors.'.format(LOGFILE)) return 1 if opts.answers is None and os.path.exists(AUTO_ANSWERS_FILE): logger.debug("Autoloading answers from %s", AUTO_ANSWERS_FILE) opts.answers = AUTO_ANSWERS_FILE if opts.answers: opts.answers = open(opts.answers) try: fcntl.flock(opts.answers, fcntl.LOCK_EX | fcntl.LOCK_NB) except OSError: logger.exception( 'Failed to lock auto answers file, proceding without it.') opts.answers.close() opts.answers = None ui = SubiquityUI() try: subiquity_interface = Subiquity(ui, opts) except ApplicationError as e: logger.exception('Failed to load Subiquity interface') print(e) return 1 subiquity_interface.run()