Skip to content

Commit

Permalink
优化skey
Browse files Browse the repository at this point in the history
  • Loading branch information
starsliao authored Oct 9, 2023
1 parent 036bf49 commit b2ebb99
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion flask-consul/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
import uuid
from units.config_log import *



skey_path = 'ConsulManager/assets/secret/skey'
if consul_kv.get_kv_dict(skey_path) == {}:
consul_kv.put_kv(skey_path,{'sk':''.join(str(uuid.uuid4()).split('-'))})
from datetime import datetime
now = datetime.strftime(datetime.now(), '%Y-%m-%d_%H-%M-%S')
skeyuid = ''.join(str(uuid.uuid4()).split('-'))
consul_kv.put_kv(skey_path,{'sk':skeyuid})
consul_kv.put_kv(skey_path + now,{'sk':skeyuid})

from views import login, blackbox, consul, jobs, nodes, selfnode, selfrds, selfredis, avd, exp, jms, edit_cloud, ldap, rds, redis
from views.prom import cloud_metrics
Expand Down

0 comments on commit b2ebb99

Please sign in to comment.