summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-05-04 09:32:47 +0300
committerDevaev Maxim <[email protected]>2019-05-04 09:32:47 +0300
commit5f5a6a9a81af0fcf6566575e400c2baf20b50eb9 (patch)
tree02e5a2ccc25afb96a7e2a4d79b5efd160815ab10
parenteccb9a41e7dbfb1a31fddca21e041b21cffa05e7 (diff)
htpasswd: correct exceptions handling
-rw-r--r--kvmd/apps/htpasswd/__init__.py2
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)