Exemple #1
0
 def __init__(self, events=None):
     connection_string = config.get_ovn_sb_connection()
     ovsdb_monitor._check_and_set_ssl_files(self.SCHEMA)
     helper = self._get_ovsdb_helper(connection_string)
     tables = ('Chassis', 'Encap', 'Port_Binding', 'Datapath_Binding',
               'SB_Global')
     for table in tables:
         helper.register_table(table)
     super(MetadataAgentOvnSbIdl, self).__init__(None, connection_string,
                                                 helper)
     if events:
         self.notify_handler.watch_events(events)
Exemple #2
0
    def schema_helper(cls):
        # SchemaHelper.get_idl_schema() sets schema_json to None which is
        # called in Idl.__init__(), so if we've done that return new helper
        try:
            if cls._schema_helper.schema_json:
                return cls._schema_helper
        except AttributeError:
            pass

        ovsdb_monitor._check_and_set_ssl_files(cls.schema)
        cls._schema_helper = idlutils.get_schema_helper(cls.connection_string,
                                                        cls.schema)
        return cls._schema_helper
Exemple #3
0
 def __init__(self, chassis=None, events=None, tables=None):
     connection_string = config.get_ovn_sb_connection()
     ovsdb_monitor._check_and_set_ssl_files(self.SCHEMA)
     helper = self._get_ovsdb_helper(connection_string)
     if tables is None:
         tables = ('Chassis', 'Encap', 'Port_Binding', 'Datapath_Binding',
                   'SB_Global')
     for table in tables:
         helper.register_table(table)
     super(MetadataAgentOvnSbIdl, self).__init__(None, connection_string,
                                                 helper)
     if chassis:
         table = ('Chassis_Private'
                  if 'Chassis_Private' in tables else 'Chassis')
         self.tables[table].condition = [['name', '==', chassis]]
     if events:
         self.notify_handler.watch_events(events)
Exemple #4
0
 def __init__(self, chassis=None, events=None, tables=None):
     connection_string = config.get_ovn_sb_connection()
     ovsdb_monitor._check_and_set_ssl_files(self.SCHEMA)
     helper = self._get_ovsdb_helper(connection_string)
     if tables is None:
         tables = ('Chassis', 'Encap', 'Port_Binding', 'Datapath_Binding',
                   'SB_Global')
     for table in tables:
         helper.register_table(table)
     try:
         super(MetadataAgentOvnSbIdl, self).__init__(None,
                                                     connection_string,
                                                     helper,
                                                     leader_only=False)
     except TypeError:
         # TODO(twilson) We can remove this when we require ovs>=2.12.0
         super(MetadataAgentOvnSbIdl,
               self).__init__(None, connection_string, helper)
     if chassis:
         for table in set(tables).intersection(
             {'Chassis', 'Chassis_Private'}):
             self.set_table_condition(table, [['name', '==', chassis]])
     if events:
         self.notify_handler.watch_events(events)