Example #1
0
            dt = parse_input_timestamp(args.date[0])
            if dt: query_string = '%s -b "%s"' % (query_string, dt)

            if len(args.date) > 1:
                dt = parse_input_timestamp(args.date[1])
                if dt: query_string = '%s -B "%s"' % (query_string, dt)

        if args.status:
            query_string += ' -s ' + ','.join(x.upper() for x in args.status)

        if args.ras:
            st = 'T'
            if args.ras == 'no': st = 'F'
            query_string += ' -i ' + ' '.join(st)

    csmii = csmi.CsmiInterface(logger, CSM_BINDIR)

    # we need to redirect the output at this point if -o option is passed
    ofile = None
    if args.output:
        try:
            ofile = open(args.output, 'w')
        except IOError as e:
            logger.error(e)
            sys.exit(1)

    if not query_string:
        logger.info(
            'No arguments passed to the query, it might take several minutes...'
        )
Example #2
0
    logf = '%s/%s-%s.log' % (mconfig['logdir'], me, runid)

    console_level = VERBOSE_LEVEL[mconfig['console_verbose'].lower()]
    log_level = VERBOSE_LEVEL[mconfig['log_verbose'].lower()]
    bds = True if mconfig['bds'].lower() == 'yes' else False

    try:
        logger = LogHandler(thismodule, console_level, log_level, True, bds,
                            logf)
    except IOError as e:
        print e
        print 'Error creating the log handlers. Exiting...'
        sys.exit(1)

    thisuser = getpass.getuser()
    csmii = csmi.CsmiInterface(logger, csmidir, usecsm,
                               mconfig['allocation_id'], runid, thisuser)

    logger.set_csmi(csmii)
    if mgmt_mode:
        import harness
        tharness = harness.Harness(mconfig, tconfig, logger, runid, logd,
                                   csmii, thisuser, args.target)
    else:
        import base_harness
        tharness = base_harness.BaseHarness(mconfig, tconfig, logger, runid,
                                            logd, csmii, thisuser, args.target)

    # now we can start logging!
    logger.ras(
        'hcdiag.fwk.started',
        'version=%s, os=%s, osversion=%s, location_name=%s' %