Пример #1
0
    def __init__(self, rule_file, discovery_server, discovery_port,
                 collector_addr):
        self.module = Module.COMPUTE_NODE_MGR
        self.module_id = ModuleNames[self.module]

        node_type = Module2NodeType[self.module]
        node_type_name = NodeTypeNames[node_type]
        self.sandesh_global = sandesh_global
        EventManager.__init__(self, rule_file, discovery_server,
                              discovery_port, collector_addr, sandesh_global)
        self.node_type = "contrail-vrouter"
        self.uve_node_type = UVENodeTypeNames[NodeType.COMPUTE]
        self.table = "ObjectVRouter"
        _disc = self.get_discovery_client()
        sandesh_global.init_generator(
            self.module_id, socket.gethostname(), node_type_name,
            self.instance_id, self.collector_addr, self.module_id, 8102,
            ['vrouter.loadbalancer', 'nodemgr.common.sandesh'], _disc)
        sandesh_global.set_logging_params(enable_local_log=True)
        self.supervisor_serverurl = "unix:///var/run/supervisord_vrouter.sock"
        self.add_current_process()
        ConnectionState.init(
            sandesh_global, socket.gethostname(),
            self.module_id, self.instance_id,
            staticmethod(ConnectionState.get_process_state_cb), NodeStatusUVE,
            NodeStatus, self.table)

        self.lb_stats = LoadbalancerStatsUVE()
        self.send_init_info()
        self.third_party_process_dict = {}
Пример #2
0
 def __init__(self, config, unit_names):
     type_info = EventManagerTypeInfo(
         module_type=Module.COMPUTE_NODE_MGR,
         object_table='ObjectVRouter',
         sandesh_packages=['vrouter.loadbalancer'])
     super(VrouterEventManager, self).__init__(config, type_info,
             sandesh_global, unit_names, update_process_list=True)
     self.lb_stats = LoadbalancerStatsUVE(self.logger)
Пример #3
0
 def __init__(self, config, unit_names):
     type_info = EventManagerTypeInfo(
         module_type=Module.COMPUTE_NODE_MGR,
         object_table='ObjectVRouter',
         sandesh_packages=['vrouter.loadbalancer'])
     super(VrouterEventManager, self).__init__(config,
                                               type_info,
                                               unit_names,
                                               update_process_list=True)
     self.host_ip = config.hostip
     self.hostname = socket.getfqdn(self.hostip) \
                     if config.hostname is None else config.hostname
     self.lb_stats = LoadbalancerStatsUVE(self.logger,
                                          self.host_ip,
                                          hostname=self.hostname)
    def __init__(self, config, rule_file, unit_names):

        if os.path.exists('/tmp/supervisord_vrouter.sock'):
            supervisor_serverurl = "unix:///tmp/supervisord_vrouter.sock"
        else:
            supervisor_serverurl = "unix:///var/run/supervisord_vrouter.sock"

        type_info = EventManagerTypeInfo(
            package_name = 'contrail-vrouter-common',
            module_type = Module.COMPUTE_NODE_MGR,
            object_table = 'ObjectVRouter',
            supervisor_serverurl = supervisor_serverurl,
            sandesh_packages = ['vrouter.loadbalancer'],
            unit_names = unit_names)
        super(VrouterEventManager, self).__init__(config, type_info, rule_file,
                sandesh_global, update_process_list=True)
        self.lb_stats = LoadbalancerStatsUVE(self.logger)
 def __init__(self, rule_file, unit_names, discovery_server, discovery_port,
              collector_addr, sandesh_config):
     type_info = EventManagerTypeInfo(
         package_name='contrail-vrouter-common',
         module_type=Module.COMPUTE_NODE_MGR,
         object_table='ObjectVRouter',
         supervisor_serverurl="unix:///var/run/supervisord_vrouter.sock",
         unit_names=unit_names)
     EventManager.__init__(self,
                           type_info,
                           rule_file,
                           discovery_server,
                           discovery_port,
                           collector_addr,
                           sandesh_global,
                           sandesh_config,
                           update_process_list=True)
     self.lb_stats = LoadbalancerStatsUVE()