diff options
author | Devaev Maxim <[email protected]> | 2019-04-06 23:26:11 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-04-06 23:26:11 +0300 |
commit | 008554ce4b9d3f7b6e4a039dff5745e9f1f5260e (patch) | |
tree | 2d83a4ed2c2487e895257e8f590da3f4249bf8dd /kvmd/apps/htpasswd/__init__.py | |
parent | b8e3ceef6d2b7becb4b7bc8b39c9f852a465c90d (diff) |
testing htpasswd
Diffstat (limited to 'kvmd/apps/htpasswd/__init__.py')
-rw-r--r-- | kvmd/apps/htpasswd/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kvmd/apps/htpasswd/__init__.py b/kvmd/apps/htpasswd/__init__.py index 27f940b9..10f90c79 100644 --- a/kvmd/apps/htpasswd/__init__.py +++ b/kvmd/apps/htpasswd/__init__.py @@ -27,7 +27,9 @@ import tempfile import contextlib import argparse +from typing import List from typing import Generator +from typing import Optional import passlib.apache @@ -74,7 +76,7 @@ def _get_htpasswd_for_write(config: Section) -> Generator[passlib.apache.Htpassw # ==== def _cmd_list(config: Section, _: argparse.Namespace) -> None: - for user in passlib.apache.HtpasswdFile(_get_htpasswd_path(config)).users(): + for user in sorted(passlib.apache.HtpasswdFile(_get_htpasswd_path(config)).users()): print(user) @@ -95,8 +97,8 @@ def _cmd_delete(config: Section, options: argparse.Namespace) -> None: # ===== -def main() -> None: - (parent_parser, argv, config) = init(add_help=False) +def main(argv: Optional[List[str]]=None) -> None: + (parent_parser, argv, config) = init(add_help=False, argv=argv) parser = argparse.ArgumentParser( prog="kvmd-htpasswd", description="Manage KVMD users (basic auth only)", |