2019-06-20 12:47:59 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*-coding:UTF-8 -*
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
import datetime
|
2019-11-05 14:18:03 +00:00
|
|
|
|
2022-11-23 10:02:33 +00:00
|
|
|
sys.path.append(os.environ['AIL_BIN'])
|
|
|
|
from lib import ConfigLoader
|
2019-06-20 12:47:59 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
|
|
start_deb = time.time()
|
|
|
|
|
2019-11-05 14:18:03 +00:00
|
|
|
config_loader = ConfigLoader.ConfigLoader()
|
|
|
|
|
|
|
|
r_serv = config_loader.get_redis_conn("ARDB_DB")
|
|
|
|
config_loader = None
|
2019-06-20 12:47:59 +00:00
|
|
|
|
2022-11-23 10:02:33 +00:00
|
|
|
# Set current ail version
|
2019-06-20 12:47:59 +00:00
|
|
|
r_serv.set('ail:version', 'v2.0')
|
|
|
|
|
|
|
|
# use new update_date format
|
|
|
|
date_tag_to_replace = ['v1.5', 'v1.7']
|
|
|
|
for tag in date_tag_to_replace:
|
|
|
|
if r_serv.exists('ail:update_date_{}'.format(tag)):
|
|
|
|
date_tag = r_serv.get('ail:update_date_{}'.format(tag))
|
|
|
|
r_serv.hset('ail:update_date', tag, date_tag)
|
|
|
|
r_serv.delete('ail:update_date_{}'.format(tag))
|
|
|
|
|
2022-11-23 10:02:33 +00:00
|
|
|
# Set current ail version
|
2019-06-20 12:47:59 +00:00
|
|
|
r_serv.hset('ail:update_date', 'v2.0', datetime.datetime.now().strftime("%Y%m%d"))
|