comparison piecrust/commands/builtin/admin.py @ 640:59968ee07a07

admin: Don't require `bcrypt` for running FoodTruck with `chef`.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 14 Feb 2016 22:06:32 -0800
parents 200c7063affa
children 466bbddd121e
comparison
equal deleted inserted replaced
639:91dd760950ad 640:59968ee07a07
93 flask_config = flask_config % {'secret_key': secret_key} 93 flask_config = flask_config % {'secret_key': secret_key}
94 with open('app.cfg', 'w', encoding='utf8') as fp: 94 with open('app.cfg', 'w', encoding='utf8') as fp:
95 fp.write(flask_config) 95 fp.write(flask_config)
96 96
97 def _generatePassword(self, ctx): 97 def _generatePassword(self, ctx):
98 import bcrypt 98 from foodtruck import bcryptfallback as bcrypt
99 binpw = ctx.args.password.encode('utf8') 99 binpw = ctx.args.password.encode('utf8')
100 hashpw = bcrypt.hashpw(binpw, bcrypt.gensalt()).decode('utf8') 100 hashpw = bcrypt.hashpw(binpw, bcrypt.gensalt()).decode('utf8')
101 logger.info(hashpw) 101 logger.info(hashpw)
102 102