mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-14 02:28:23 +00:00
34 lines
914 B
Python
34 lines
914 B
Python
|
#!/usr/bin/env python3
|
||
|
# -*-coding:UTF-8 -*
|
||
|
|
||
|
import os
|
||
|
import sys
|
||
|
import time
|
||
|
import redis
|
||
|
import datetime
|
||
|
import configparser
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
|
||
|
start_deb = time.time()
|
||
|
|
||
|
configfile = os.path.join(os.environ['AIL_BIN'], 'packages/config.cfg')
|
||
|
if not os.path.exists(configfile):
|
||
|
raise Exception('Unable to find the configuration file. \
|
||
|
Did you set environment variables? \
|
||
|
Or activate the virtualenv.')
|
||
|
cfg = configparser.ConfigParser()
|
||
|
cfg.read(configfile)
|
||
|
|
||
|
r_serv = redis.StrictRedis(
|
||
|
host=cfg.get("ARDB_DB", "host"),
|
||
|
port=cfg.getint("ARDB_DB", "port"),
|
||
|
db=cfg.getint("ARDB_DB", "db"),
|
||
|
decode_responses=True)
|
||
|
|
||
|
#Set current ail version
|
||
|
r_serv.set('ail:version', 'v1.7')
|
||
|
|
||
|
#Set current ail version
|
||
|
r_serv.set('ail:update_date_v1.7', datetime.datetime.now().strftime("%Y%m%d"))
|