示例#1
0
            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...'
        )

    rc = csmii.run_query(query_string, args.runid, args.results, ofile)

    if rc:
        logger.error('Query failed with rc = {0} '.format(rc))

    if ofile:
        logger.info('output saved, file:  {0} '.format(args.output))
示例#2
0
    logger.info('Using tests configuration file {0}.'.format(
        mconfig['testproperties']))
    logger.info(
        'Health Check Diagnostics, run id {0}, initializing...'.format(runid))

    #-- validate the test(s)

    if args.test:
        logger.info('Validating command argument test.')
        ret = tharness.validate_test(args.test)
    else:  # it is bucket
        logger.info('Validating command argument bucket.')
        ret = tharness.validate_bucket(args.bucket[0])

    if ret == False:
        logger.error('Invalid test/bucket argument. Exiting...')
        sys.exit(1)

    #-- check target syntax and check if target responds to sshd
    logger.info('Validating command argument target.')
    ret = tharness.validate_target()

    if ret == False:
        logger.error('Error validating target argument. Exiting...')
        sys.exit(1)

    # subscribe for signal  (after csmi initialization)
    subscribe_to_signal()

    # todo: pass xcat noderange
    # we are doing delayed allocation. If all tests are targetType=management, we don't create allocation