Exemplo n.º 1
0
Arquivo: rz.py Projeto: yuvadm/rhizi
 def __init__(self, config_dir):
     cfg = init_config(config_dir)
     kernel = RZ_Kernel()
     db_ctl = dbc.DB_Controller(cfg.db_base_url)
     kernel.db_ctl = db_ctl
     user_db = Fake_User_DB()
     webapp = init_webapp(cfg, kernel)
     webapp.user_db = user_db
     kernel.db_op_factory = webapp  # assist kernel with DB initialization
     kernel.start()
     time.sleep(0.1)
     self.kernel = kernel
Exemplo n.º 2
0
    def setUpClass(self):
        cfg = RZ_Config.init_from_file("res/etc/rhizi-server.conf")
        self.db_ctl = db_controller.DB_Controller(cfg.db_base_url)
        self.log = logging.getLogger("rhizi")
        self.log.addHandler(logging.StreamHandler())

        # bootstrap kernel
        kernel = RZ_Kernel()
        kernel.db_ctl = self.db_ctl
        kernel.db_op_factory = DBO_factory__default()
        kernel.start()

        self.kernel = kernel

        while not self.kernel.is_DB_status__ok():  # wait for kernel to initialize...
            time.sleep(0.3)
Exemplo n.º 3
0
    def setUpClass(self):
        cfg = RZ_Config.init_from_file('res/etc/rhizi-server.conf')
        self.db_ctl = db_controller.DB_Controller(cfg.db_base_url)
        self.log = logging.getLogger('rhizi')
        self.log.addHandler(logging.StreamHandler())

        # bootstrap kernel
        kernel = RZ_Kernel()
        kernel.db_ctl = self.db_ctl
        kernel.db_op_factory = DBO_factory__default()
        kernel.start()

        self.kernel = kernel

        while not self.kernel.is_DB_status__ok(
        ):  # wait for kernel to initialize...
            time.sleep(0.3)
Exemplo n.º 4
0
            log.warn(
                '[!] access control disabled, all-granted access set on all URLs'
            )

        init_signal_handlers()
        init_user_db(cfg)
    except Exception as e:
        log.exception('failed to initialize server')
        traceback.print_exc()
        exit(-1)

    #
    # init kernel
    #
    kernel = RZ_Kernel()
    kernel.db_ctl = DB_Controller(cfg.db_base_url)

    #
    # init webapp
    #
    webapp = init_webapp(cfg, kernel)
    webapp.user_db = user_db
    kernel.db_op_factory = webapp  # assist kernel with DB initialization
    ws_srv = init_ws_interface(cfg, kernel, webapp)

    try:
        kernel.start()
        ws_srv.serve_forever()
    except Exception as e:
        log.exception(e)
Exemplo n.º 5
0
        log.info('loaded configuration:\n%s' % cfg_indent_str)  # print indented
        if False == cfg.access_control:
            log.warn('[!] access control disabled, all-granted access set on all URLs')

        init_signal_handlers()
        init_user_db(cfg)
    except Exception as e:
        log.exception('failed to initialize server')
        traceback.print_exc()
        exit(-1)

    #
    # init kernel
    #
    kernel = RZ_Kernel()
    kernel.db_ctl = DB_Controller(cfg.db_base_url)

    #
    # init webapp
    #
    webapp = init_webapp(cfg, kernel)
    webapp.user_db = user_db
    kernel.db_op_factory = webapp  # assist kernel with DB initialization
    ws_srv = init_ws_interface(cfg, kernel, webapp)

    try:
        kernel.start()
        ws_srv.serve_forever()
    except Exception as e:
        log.exception(e)