diff options
author | Devaev Maxim <[email protected]> | 2019-06-28 18:59:36 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-06-28 18:59:36 +0300 |
commit | ef3c62a7af520673154233e2d3c89492ffec3195 (patch) | |
tree | 2b78c5918143eff8ef2c89484ac99fc6b7588438 /kvmd/apps/htpasswd/__init__.py | |
parent | ff270591b032cc1f8e342f20a04b84e5dbb31191 (diff) |
f-strings
Diffstat (limited to 'kvmd/apps/htpasswd/__init__.py')
-rw-r--r-- | kvmd/apps/htpasswd/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/apps/htpasswd/__init__.py b/kvmd/apps/htpasswd/__init__.py index 05d191f0..1a666d0f 100644 --- a/kvmd/apps/htpasswd/__init__.py +++ b/kvmd/apps/htpasswd/__init__.py @@ -45,7 +45,8 @@ from .. import init # ===== def _get_htpasswd_path(config: Section) -> str: if config.kvmd.auth.internal_type != "htpasswd": - raise SystemExit("Error: KVMD internal auth not using 'htpasswd' (now configured %r)" % (config.kvmd.auth.internal_type)) + raise SystemExit(f"Error: KVMD internal auth not using 'htpasswd'" + f" (now configured {config.kvmd.auth.internal_type!r})") return config.kvmd.auth.internal.file @@ -53,7 +54,7 @@ def _get_htpasswd_path(config: Section) -> str: def _get_htpasswd_for_write(config: Section) -> Generator[passlib.apache.HtpasswdFile, None, None]: path = _get_htpasswd_path(config) (tmp_fd, tmp_path) = tempfile.mkstemp( - prefix=".%s." % (os.path.basename(path)), + prefix=f".{os.path.basename(path)}.", dir=os.path.dirname(path), ) try: |