diff options
author | Devaev Maxim <[email protected]> | 2019-05-04 09:32:47 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-05-04 09:32:47 +0300 |
commit | 5f5a6a9a81af0fcf6566575e400c2baf20b50eb9 (patch) | |
tree | 02e5a2ccc25afb96a7e2a4d79b5efd160815ab10 /kvmd | |
parent | eccb9a41e7dbfb1a31fddca21e041b21cffa05e7 (diff) |
htpasswd: correct exceptions handling
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/apps/htpasswd/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kvmd/apps/htpasswd/__init__.py b/kvmd/apps/htpasswd/__init__.py index c6f56087..05d191f0 100644 --- a/kvmd/apps/htpasswd/__init__.py +++ b/kvmd/apps/htpasswd/__init__.py @@ -57,8 +57,8 @@ def _get_htpasswd_for_write(config: Section) -> Generator[passlib.apache.Htpassw dir=os.path.dirname(path), ) try: - stat = os.stat(path) try: + stat = os.stat(path) with open(path, "rb") as htpasswd_file: os.write(tmp_fd, htpasswd_file.read()) os.fchown(tmp_fd, stat.st_uid, stat.st_gid) |