Пример #1
0
 def __init__(self, segid_min, segid_max, res_name, cfg, reuse_timeout=0):
     # Have a check here to ensure a crazy init is not called TODO(padkrish)
     db.configure_db(cfg)
     self.seg_id_ranges = [(segid_min, segid_max)]
     self.seg_timeout = reuse_timeout
     if res_name is const.RES_SEGMENT:
         self.model_obj = DfaSegment()
     if res_name is const.RES_VLAN:
         self.model_obj = DfaVlan()
     self.model = self.model_obj.get_model()
     if not self.model_obj.is_init_done():
         self._seg_id_allocations()
         self.model_obj.init_done()
Пример #2
0
 def __init__(self, cfg):
     # Configure database.
     db.configure_db(cfg)
Пример #3
0
 def __init__(self, cfg):
     # Configure database.
     db.configure_db(cfg)
Пример #4
0
 def __init__(self, cfg):
     # Configure database.
     super(DfaDBMixin, self).__init__(cfg)
     db.configure_db(cfg)
Пример #5
0
 def __init__(self, cfg):
     """Configure database. """
     super(TopologyDiscoveryDb, self).__init__()
     db.configure_db(cfg)