2019-06-24 13:51:42 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*-coding:UTF-8 -*
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
import redis
|
|
|
|
import argparse
|
|
|
|
import datetime
|
|
|
|
import configparser
|
|
|
|
|
2022-07-08 07:47:47 +00:00
|
|
|
sys.path.append(os.environ['AIL_BIN'])
|
|
|
|
##################################
|
|
|
|
# Import Project packages
|
|
|
|
##################################
|
|
|
|
from lib import ail_updates
|
2019-11-05 14:18:03 +00:00
|
|
|
|
2019-06-24 13:51:42 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
parser = argparse.ArgumentParser(description='AIL default update')
|
|
|
|
parser.add_argument('-t', help='version tag' , type=str, dest='tag', required=True)
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
if not args.tag:
|
|
|
|
parser.print_help()
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
# remove space
|
|
|
|
update_tag = args.tag.replace(' ', '')
|
2022-07-08 07:47:47 +00:00
|
|
|
if not ail_updates.check_version(update_tag):
|
|
|
|
parser.print_help()
|
|
|
|
print(f'Error: Invalid update tag {update_tag})
|
|
|
|
sys.exit(0)
|
2019-06-24 13:51:42 +00:00
|
|
|
|
|
|
|
start_deb = time.time()
|
|
|
|
|
2022-07-08 07:47:47 +00:00
|
|
|
ail_updates.add_ail_update(update_tag)
|