From 3332c36629b950ff8a28d6f5bd71c23658ed3756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Mon, 12 Apr 2021 14:22:38 +0300 Subject: [PATCH] Create client config paths when necesary --- pinecrypt/client/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pinecrypt/client/cli.py b/pinecrypt/client/cli.py index 10a726c..2f871d5 100644 --- a/pinecrypt/client/cli.py +++ b/pinecrypt/client/cli.py @@ -52,7 +52,10 @@ class ConfigTreeParser(ConfigParser): @click.argument("authority") def certidude_provision(authority): client_config = ConfigParser() - os.makedirs(os.path.dirname(const.CLIENT_CONFIG_PATH)) + try: + os.makedirs(os.path.dirname(const.CLIENT_CONFIG_PATH)) + except FileExistsError: + pass if os.path.exists(const.CLIENT_CONFIG_PATH): client_config.read_file(open(const.CLIENT_CONFIG_PATH)) if client_config.has_section(authority):