2021-04-14 16:27:39 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*-coding:UTF-8 -*
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
|
2022-07-08 09:47:47 +02:00
|
|
|
sys.path.append(os.environ['AIL_BIN'])
|
|
|
|
##################################
|
|
|
|
# Import Project packages
|
|
|
|
##################################
|
|
|
|
from lib import ail_updates
|
|
|
|
from lib.ConfigLoader import ConfigLoader
|
2021-04-14 16:27:39 +02:00
|
|
|
|
|
|
|
class AIL_Updater(object):
|
|
|
|
"""docstring for AIL_Updater."""
|
|
|
|
|
|
|
|
def __init__(self, new_version):
|
|
|
|
self.version = new_version
|
|
|
|
self.start_time = time.time()
|
|
|
|
|
2022-07-08 09:47:47 +02:00
|
|
|
self.config = ConfigLoader()
|
2023-07-12 11:36:47 +02:00
|
|
|
self.r_serv = self.config.get_db_conn("Kvrocks_DB")
|
2021-04-14 16:27:39 +02:00
|
|
|
|
|
|
|
self.f_version = float(self.version[1:])
|
2022-07-08 09:47:47 +02:00
|
|
|
self.current_f_version = ail_updates.get_ail_float_version()
|
2021-04-14 16:27:39 +02:00
|
|
|
|
|
|
|
def update(self):
|
|
|
|
"""
|
|
|
|
AIL DB update
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
def end_update(self):
|
|
|
|
"""
|
|
|
|
Update DB version
|
|
|
|
"""
|
2023-07-12 11:36:47 +02:00
|
|
|
ail_updates.add_ail_update(self.version)
|
2021-04-14 16:27:39 +02:00
|
|
|
|
|
|
|
def run_update(self):
|
|
|
|
self.update()
|
|
|
|
self.end_update()
|