From 5f5a6a9a81af0fcf6566575e400c2baf20b50eb9 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sat, 4 May 2019 09:32:47 +0300 Subject: htpasswd: correct exceptions handling --- kvmd/apps/htpasswd/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kvmd/apps') 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) -- cgit v1.2.3