Пример #1
0
    def _get_metadata_proxy_callback(cls,
                                     port,
                                     conf,
                                     network_id=None,
                                     router_id=None):
        uuid = network_id or router_id
        if uuid is None:
            raise exceptions.NetworkIdOrRouterIdRequiredError()

        if network_id:
            lookup_param = '--network_id=%s' % network_id
        else:
            lookup_param = '--router_id=%s' % router_id

        def callback(pid_file):
            metadata_proxy_socket = conf.metadata_proxy_socket
            user, group, watch_log = (
                cls._get_metadata_proxy_user_group_watchlog(conf))
            proxy_cmd = [
                'neutron-ns-metadata-proxy',
                '--pid_file=%s' % pid_file,
                '--metadata_proxy_socket=%s' % metadata_proxy_socket,
                lookup_param,
                '--state_path=%s' % conf.state_path,
                '--metadata_port=%s' % port,
                '--metadata_proxy_user=%s' % user,
                '--metadata_proxy_group=%s' % group
            ]
            proxy_cmd.extend(
                config.get_log_args(conf,
                                    'neutron-ns-metadata-proxy-%s.log' % uuid,
                                    metadata_proxy_watch_log=watch_log))
            return proxy_cmd

        return callback
Пример #2
0
    def __init__(self, network_id, router_id, unix_socket_path, port, user,
                 group, state_path, pid_file):
        self.network_id = network_id
        self.router_id = router_id
        if network_id is None and router_id is None:
            raise exceptions.NetworkIdOrRouterIdRequiredError()

        self.port = port
        self.user = user
        self.group = group
        self.state_path = state_path
        self.unix_socket_path = unix_socket_path
        self.pidfile = pid_file
        self.log_level = 'debug' if cfg.CONF.debug else 'info'
Пример #3
0
    def __init__(self, network_id, router_id, unix_socket_path, port, user,
                 group, state_path, pid_file):
        self.network_id = network_id
        self.router_id = router_id
        if network_id is None and router_id is None:
            raise exceptions.NetworkIdOrRouterIdRequiredError()

        self.port = port
        self.user = user
        self.group = group
        self.state_path = state_path
        self.unix_socket_path = unix_socket_path
        self.pidfile = pid_file
        self.log_level = (
            'debug' if logging.is_debug_enabled(cfg.CONF) else 'info')
        # log-tag will cause entries to have the string pre-pended, so use
        # the uuid haproxy will be started with.  Additionally, if it
        # starts with "haproxy" then things will get logged to
        # /var/log/haproxy.log on Debian distros, instead of to syslog.
        uuid = network_id or router_id
        self.log_tag = "haproxy-" + METADATA_SERVICE_NAME + "-" + uuid
Пример #4
0
    def __init__(self, network_id=None, router_id=None):
        self.network_id = network_id
        self.router_id = router_id

        if network_id is None and router_id is None:
            raise exceptions.NetworkIdOrRouterIdRequiredError()