Fix generate_ticketkey for python3
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
parent
52010621fb
commit
394aacec19
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/python
|
#!/bin/python3
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ if len(sys.argv[2]) != 6:
|
||||||
raise Exception('Environment name must be exactly 6 characters')
|
raise Exception('Environment name must be exactly 6 characters')
|
||||||
|
|
||||||
with open(sys.argv[1], 'wb') as tkey:
|
with open(sys.argv[1], 'wb') as tkey:
|
||||||
tkey.write('%s%s' % (sys.argv[2], datetime.utcnow().strftime('%Y%m%d%H')))
|
value = ''.join([sys.argv[2], datetime.utcnow().strftime('%Y%m%d%H')])
|
||||||
|
tkey.write(value.encode('utf-8'))
|
||||||
with open('/dev/random', 'rb') as rand:
|
with open('/dev/random', 'rb') as rand:
|
||||||
tkey.write(rand.read(32))
|
tkey.write(rand.read(32))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue