示例#1
0
文件: test_puck.py 项目: masom/Puck
 def testGetVM(self):
     p = Puck(transport=MockTransport)
     self.assertTrue(isinstance(p.getVM(), VM))
示例#2
0
    (pid, ezjl_socket) = start_jail_launcher()

    if args.daemonize:
        daemonizer = cherrypy.process.plugins.Daemonizer(cherrypy.engine)
        daemonizer.subscribe()


    cherrypy.config.update(args.config)

    lookup = TemplateLookup(
        directories=[os.path.join(args.templatedir, reldir) for reldir in ["html"]]
    )

    puck = Puck()
    puck.getVM().jails.setSocket(ezjl_socket)

    root = RootController(lookup, puck)
    root.configure = ConfigurationController(lookup, puck)
    root.setup = SetupController(lookup, puck)

    cherrypy.engine.vmsetup = SetupPlugin(puck, cherrypy.engine)
    cherrypy.engine.vmsetup.subscribe()

    cherrypy.process.plugins.SignalHandler.handlers['SIGINT'] = cherrypy.engine.exit
    cherrypy.engine.signal_handler.subscribe()

    if hasattr(cherrypy.engine, "console_control_handler"):
        cherrypy.engine.console_control_handler.subscribe()

    app = cherrypy.tree.mount(root, '/', CONF)