예제 #1
0
    def __init__(self, log_ctl):
        die_when_parent_die()

        self._cmd_context = NetTestCommandContext()
        port = lnst_config.get_option("environment", "rpcport")
        logging.info("Using RPC port %d." % port)
        self._server_handler = ServerHandler(("", port))
        self._if_manager = InterfaceManager(self._server_handler)

        self._server_handler.set_if_manager(self._if_manager)

        self._net_namespaces = {}

        self._methods = SlaveMethods(self._cmd_context, log_ctl,
                                     self._if_manager, self._net_namespaces,
                                     self._server_handler, self)

        self.register_die_signal(signal.SIGHUP)
        self.register_die_signal(signal.SIGINT)
        self.register_die_signal(signal.SIGTERM)

        self._finished = False

        self._log_ctl = log_ctl

        self._server_handler.add_connection('netlink',
                                            self._if_manager.get_nl_socket())
예제 #2
0
    def __init__(self, log_ctl, port=DefaultRPCPort):
        die_when_parent_die()

        self._cmd_context = NetTestCommandContext()
        self._netconfig = NetConfig()
        self._methods = SlaveMethods(self._cmd_context, self._netconfig,
                                     log_ctl)

        self.register_die_signal(signal.SIGHUP)
        self.register_die_signal(signal.SIGINT)
        self.register_die_signal(signal.SIGTERM)

        self._server_handler = ServerHandler(("", port))

        self._finished = False

        self._log_ctl = log_ctl
예제 #3
0
    def __init__(self, log_ctl, port=DefaultRPCPort):
        die_when_parent_die()

        self._cmd_context = NetTestCommandContext()
        self._server_handler = ServerHandler(("", port))
        self._if_manager = InterfaceManager(self._server_handler)

        self._net_namespaces = {}

        self._methods = SlaveMethods(self._cmd_context, log_ctl,
                                     self._if_manager, self._net_namespaces,
                                     self._server_handler, self)

        self.register_die_signal(signal.SIGHUP)
        self.register_die_signal(signal.SIGINT)
        self.register_die_signal(signal.SIGTERM)

        self._finished = False

        self._log_ctl = log_ctl

        self._server_handler.add_connection('netlink',
                                            self._if_manager.get_nl_socket())