Ejemplo n.º 1
0
def do_pull(args):
  logging.info('==== PULL ====')

  source, dest = args.SOURCE, args.DEST

  mounter = image_sources.create_composite_mounter_by_args(args)
  with mounter as file_accessor:
    with file_accessor.prepare_file(source) as filename:
      if not filename:
        print >> sys.stderr, 'Can not dump file: {}'.format(source)
      else:
        logging.debug('Copy %s -> %s', filename, dest)
        shutil.copy(filename, dest)

  logging.info('==== DONE ====')
Ejemplo n.º 2
0
def do_pull(args):
    logging.info('==== PULL ====')

    source, dest = args.SOURCE, args.DEST

    mounter = image_sources.create_composite_mounter_by_args(args)
    with mounter as file_accessor:
        with file_accessor.prepare_file(source) as filename:
            if not filename:
                print >> sys.stderr, 'Can not dump file: {}'.format(source)
            else:
                logging.debug('Copy %s -> %s', filename, dest)
                shutil.copy(filename, dest)

    logging.info('==== DONE ====')
Ejemplo n.º 3
0
def do_check_compat(args):
    """The actual function to do 'gsi_util check_compat' command."""
    logging.info('==== CHECK_COMPAT ====')
    logging.info('  system=%s vendor=%s', args.system, args.vendor)

    check_list = (checker.Checker.make_check_list(args.CHECK_ITEM)
                  if args.CHECK_ITEM else checker.Checker.get_all_check_list())
    logging.debug('Starting check list: %s', _format_check_list(check_list))
    mounter = image_sources.create_composite_mounter_by_args(args)
    with mounter as file_accessor:
        the_checker = checker.Checker(file_accessor)
        check_result = the_checker.check(check_list)

    reporter = CheckReporter()
    if args.only_summary:
        reporter.set_only_summary()
    reporter.output(check_result)

    logging.info('==== DONE ====')
Ejemplo n.º 4
0
def do_check_compat(args):
  """The actual function to do 'gsi_util check_compat' command."""
  logging.info('==== CHECK_COMPAT ====')
  logging.info('  system=%s vendor=%s', args.system, args.vendor)

  check_list = (checker.Checker.make_check_list(args.CHECK_ITEM)
                if args.CHECK_ITEM else checker.Checker.get_all_check_list())
  logging.debug('Starting check list: %s', _format_check_list(check_list))
  mounter = image_sources.create_composite_mounter_by_args(args)
  with mounter as file_accessor:
    the_checker = checker.Checker(file_accessor)
    check_result = the_checker.check(check_list)

  reporter = CheckReporter()
  if args.only_summary:
    reporter.set_only_summary()
  reporter.output(check_result)

  logging.info('==== DONE ====')
Ejemplo n.º 5
0
def do_check_compat(args):
    logging.info('==== CHECK_COMPAT ====')
    logging.info('  system=%s vendor=%s', args.system, args.vendor)

    logging.debug('Checking ID list: %s', args.ID)
    check_list = Checker.make_check_list_with_ids(args.ID) if len(
        args.ID) else Checker.get_all_check_list()

    mounter = image_sources.create_composite_mounter_by_args(args)
    with mounter as file_accessor:
        checker = Checker(file_accessor)
        check_result = checker.check(check_list)

    reporter = CheckReporter()
    if args.only_summary:
        reporter.set_only_summary()
    reporter.output(check_result)

    logging.info('==== DONE ====')
Ejemplo n.º 6
0
def do_dump(args):
    logging.info('==== DUMP ====')

    logging.debug('Info name list: %s', args.INFO_NAME)
    dump_list = dumper.Dumper.make_dump_list_by_name_list(
        args.INFO_NAME) if len(
            args.INFO_NAME) else dumper.Dumper.get_all_dump_list()

    mounter = image_sources.create_composite_mounter_by_args(args)
    with mounter as file_accessor:
        d = dumper.Dumper(file_accessor)
        dump_result_dict = d.dump(dump_list)

    # reserved for output to a file
    os = sys.stdout
    reporter = DumpReporter(os, (x.info_name for x in dump_list))
    if args.show_unknown:
        reporter.set_show_unknown()
    reporter.output(dump_result_dict)

    logging.info('==== DONE ====')