Create client config paths when necesary

This commit is contained in:
Lauri Võsandi 2021-04-12 14:22:38 +03:00
parent a78b0f21ba
commit 3332c36629
1 changed files with 4 additions and 1 deletions

View File

@ -52,7 +52,10 @@ class ConfigTreeParser(ConfigParser):
@click.argument("authority")
def certidude_provision(authority):
client_config = ConfigParser()
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):