def __init__(self, uid, host, port, boss_port):
        self.uid = uid
        self.boss_port = boss_port
        self.host = host
        self.port = port
        self.boss_api_handler = BossClient(host, boss_port).boss_access

        if in_parent_process():
            save_pid_file("pretend_extended-mock-{0}.pid".format(uid))
示例#2
0
def run(host='localhost', port=8000):
    "Start the mock HTTP server"
    data.BOSS_PORT = port
    if in_parent_process():
        if settings.RUN_MAINTAINER:
            LOGGER.debug('Starting maintainer process')
            launch_maintainer()
        save_pid_file('pretend_extended-boss.pid')

    bottle.run(app=pretender_app, host=host, port=port, reloader=True)