コード例 #1
0
ファイル: kittenherder.py プロジェクト: ccooper/briar-patch
        if items is not None:
            result = items.split('\n')

    elif os.path.exists(options.kittens):
        result = open(options.kittens, 'r').readlines()

    elif ',' in options.kittens:
        result = options.kittens.split(',')
    else:
        result.append(options.kittens)

    return result


if __name__ == "__main__":
    options = initOptions(params=_defaultOptions)

    initLogs(options, chatty=False)

    if options.cachefile is None:
        options.cachefile = os.path.join(options.appPath, 'kittenherder_seen.dat')

    if options.kittens is None:
        log.info('kitten list not specified, defaulting to %s' % urlNeedingReboot)
        options.kittens = urlNeedingReboot

    if options.filter is not None:
        reFilter = re.compile(options.filterbase % options.filter)
    else:
        reFilter = None
コード例 #2
0
ファイル: bpServer.py プロジェクト: rhelmer/briar-patch
    log.info('done')


_defaultOptions = { 'config':      ('-c', '--config',      None,  'Configuration file'),
                    'debug':       ('-d', '--debug',       True,  'Enable Debug', 'b'),
                    'background':  ('-b', '--background',  False, 'daemonize ourselves', 'b'),
                    'logpath':     ('-l', '--logpath',     None,  'Path where log file is to be written'),
                    'address':     ('',   '--address' ,    None,  'IP Address'),
                    'archivepath': ('',   '--archivepath', '.',   'Path where incoming jobs are to be archived'),
                    'redis':       ('-r', '--redis',      'localhost:6379', 'Redis connection string'),
                    'redisdb':     ('',   '--redisdb',    '8',              'Redis database'),
                  }

if __name__ == '__main__':
    options = initOptions(_defaultOptions)
    initLogs(options)

    log.info('Starting')

    if options.address is None:
        log.error('Address is a required parameter, exiting')
        sys.exit(2)

    db = dbRedis(options)

    log.info('Creating processes')
    Process(name='worker', target=worker, args=(jobQueue, metricQueue, db, options.archivepath)).start()
    Process(name='metric', target=metric, args=(metricQueue, options)).start()

    if ':' not in options.address:
コード例 #3
0
                s = 'recovery needed, could not reboot host'
            else:
                s = '%12s\n%s' % ('reboot requested but not performed', r['output'])
            print s

        if options.stop:
            print host.graceful_shutdown()

_options = { 'reboot': ('-r', '--reboot', False, 'reboot host if required'),
             'info':   ('-i', '--info',   False, 'show passive info only, do not ssh to host'),
             'stop':   ('',   '--stop',   False, 'stop buildbot for host'),
           }


if __name__ == "__main__":
    options = initOptions(params=_options)

    initLogs(options, chatty=False, loglevel=logging.ERROR)

    log.debug('Starting')

    initKeystore(options)

    remoteEnv = releng.remote.RemoteEnvironment(options.tools, passive=options.info)

    for kitten in options.args:
        if kitten in remoteEnv.hosts:
            check(kitten)
        else:
            log.error('%s is not listed in slavealloc' % kitten)
コード例 #4
0
ファイル: bpDashboard.py プロジェクト: ccooper/briar-patch
    for host, weight in swtKittens[:10]:
        h.write(kTableDetail % kittens[host])
    h.write(kTableFooter)

    h.close()


_defaultOptions = {
    'config': ('-c', '--config', None, 'Configuration file'),
    'debug': ('-d', '--debug', True, 'Enable Debug', 'b'),
    'logpath':
    ('-l', '--logpath', None, 'Path where log file is to be written'),
    'redis': ('-r', '--redis', 'localhost:6379', 'Redis connection string'),
    'redisdb': ('', '--redisdb', '8', 'Redis database'),
}

if __name__ == '__main__':
    options = initOptions(params=_defaultOptions)
    initLogs(options)

    log.info('Starting')

    log.info('Connecting to datastore')
    db = dbRedis(options)

    if db.ping():
        loadSAdata()
        indexPage(db)

    log.info('done')
コード例 #5
0
ファイル: rbug.py プロジェクト: ccooper/briar-patch
                        issues.append('m.group(1)')
                log.info("Didn't find buildbot.tac")
                issues.append('no tacfile')
        except:
            log.info(
                'exception during processing of %s - but then again it is *supposed* to be offline'
                % slave.hostname)

    if len(issues) == 0:
        buglist = getBugs(host)
    else:
        print issues


if __name__ == "__main__":
    options = initOptions(_defaultOptions)
    initLogs(options)

    logging.getLogger("paramiko.transport").setLevel(logging.WARNING)

    if options.tools is None:
        options.tools = '/builds/tools'

    log.info('Starting')

    # grab and process slavealloc list into a simple dictionary
    slaves = {}
    slavelist = json.loads(fetchUrl('%s/slaves' % urlSlaveAlloc))
    for item in slavelist:
        if item['notes'] is None:
            item['notes'] = ''