diff options
author | Jae Lo Presti <me@jae.fi> | 2022-05-19 14:03:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-19 13:03:13 +0000 |
commit | f16ec055cc235eed1ae02f7cede99c366fedca5e (patch) | |
tree | 193b5507d96b38cc1633fe03a5c7d8355bb1b194 /synapse/_scripts/hash_password.py | |
parent | Simplify untyped-defs config in mypy.ini (#12790) (diff) | |
download | synapse-f16ec055cc235eed1ae02f7cede99c366fedca5e.tar.xz |
hash_password: raise an error if no config file is specified (#12789)
Diffstat (limited to '')
-rwxr-xr-x | synapse/_scripts/hash_password.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/_scripts/hash_password.py b/synapse/_scripts/hash_password.py index 3aa29de5bd..3bed367be2 100755 --- a/synapse/_scripts/hash_password.py +++ b/synapse/_scripts/hash_password.py @@ -46,14 +46,14 @@ def main() -> None: "Path to server config file. " "Used to read in bcrypt_rounds and password_pepper." ), + required=True, ) args = parser.parse_args() - if "config" in args and args.config: - config = yaml.safe_load(args.config) - bcrypt_rounds = config.get("bcrypt_rounds", bcrypt_rounds) - password_config = config.get("password_config", None) or {} - password_pepper = password_config.get("pepper", password_pepper) + config = yaml.safe_load(args.config) + bcrypt_rounds = config.get("bcrypt_rounds", bcrypt_rounds) + password_config = config.get("password_config", None) or {} + password_pepper = password_config.get("pepper", password_pepper) password = args.password if not password: |