Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOsirisInferi <github@flut.demon.nl>2020-02-06 00:17:29 +0300
committerOsirisInferi <github@flut.demon.nl>2020-02-06 00:17:29 +0300
commitf3ed13374456f3b53fc87dc0fa1ed71b1efa37e7 (patch)
treed3aa0b5bf68699fdffa7d78db1fcdabf356aa840
parent601a114d1ba6030f3f765ff86bb39658172e0a75 (diff)
Wrap makedirs() within exception handelrs
-rw-r--r--certbot-apache/certbot_apache/_internal/http_01.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/certbot-apache/certbot_apache/_internal/http_01.py b/certbot-apache/certbot_apache/_internal/http_01.py
index 53ccd2bc7..ad62a77bb 100644
--- a/certbot-apache/certbot_apache/_internal/http_01.py
+++ b/certbot-apache/certbot_apache/_internal/http_01.py
@@ -169,8 +169,14 @@ class ApacheHttp01(common.ChallengePerformer):
def _set_up_challenges(self):
if not os.path.isdir(self.challenge_dir):
old_umask = os.umask(0o022)
- filesystem.makedirs(self.challenge_dir, 0o755)
- os.umask(old_umask)
+ try:
+ filesystem.makedirs(self.challenge_dir, 0o755)
+ except OSError as exception:
+ if exception.errno not in (errno.EEXIST, errno.EISDIR):
+ raise errors.PluginError(
+ "Couldn't create root for http-01 challenge")
+ finally:
+ os.umask(old_umask)
responses = []
for achall in self.achalls: