ctl: use bytes in check_hobos command (#36515)

This commit is contained in:
Frédéric Péters 2019-11-15 20:34:18 +01:00
parent b401245d4b
commit 8c1fc39764
1 changed files with 3 additions and 3 deletions

View File

@ -464,7 +464,7 @@ class CmdCheckHobos(Command):
portal_agent_url, portal_agent_url)
config.set('options', 'backoffice_extra_head', extra_head)
with open(site_options_filepath, 'wb') as site_options:
with open(site_options_filepath, 'w') as site_options:
config.write(site_options)
def normalize_database_name(self, database_name):
@ -547,8 +547,8 @@ class CmdCheckHobos(Command):
@classmethod
def shared_secret(cls, secret1, secret2):
secret1 = hashlib.sha256(secret1).hexdigest()
secret2 = hashlib.sha256(secret2).hexdigest()
secret1 = hashlib.sha256(force_bytes(secret1)).hexdigest()
secret2 = hashlib.sha256(force_bytes(secret2)).hexdigest()
return hex(int(secret1, 16) ^ int(secret2, 16))[2:-1]