2019-11-20 16:15:08 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*-coding:UTF-8 -*
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
import datetime
|
|
|
|
|
2022-11-23 11:02:33 +01:00
|
|
|
sys.path.append(os.environ['AIL_BIN'])
|
|
|
|
from lib import ConfigLoader
|
2019-11-20 16:15:08 +01:00
|
|
|
|
|
|
|
new_version = 'v2.5'
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
|
|
start_deb = time.time()
|
|
|
|
|
|
|
|
config_loader = ConfigLoader.ConfigLoader()
|
|
|
|
r_serv = config_loader.get_redis_conn("ARDB_DB")
|
|
|
|
config_loader = None
|
|
|
|
|
2022-11-29 16:01:01 +01:00
|
|
|
r_serv.zadd('ail:all_role', {'user': 3})
|
|
|
|
r_serv.zadd('ail:all_role', {'user_no_api': 4})
|
|
|
|
r_serv.zadd('ail:all_role', {'read_only': 5})
|
2019-11-20 16:15:08 +01:00
|
|
|
|
2019-11-25 10:27:32 +01:00
|
|
|
for user in r_serv.hkeys('user:all'):
|
2019-11-20 16:15:08 +01:00
|
|
|
r_serv.sadd('user_role:user', user)
|
|
|
|
r_serv.sadd('user_role:user_no_api', user)
|
|
|
|
r_serv.sadd('user_role:read_only', user)
|
|
|
|
|
2022-11-23 11:02:33 +01:00
|
|
|
# Set current ail version
|
2019-11-20 16:15:08 +01:00
|
|
|
r_serv.set('ail:version', new_version)
|
|
|
|
|
2022-11-23 11:02:33 +01:00
|
|
|
# Set current ail version
|
2019-11-20 16:15:08 +01:00
|
|
|
r_serv.hset('ail:update_date', new_version, datetime.datetime.now().strftime("%Y%m%d"))
|