Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix directory errors in hana_utils #500

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions neon_utils/hana_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import requests
import json

from os.path import join, isfile
from os import makedirs
from os.path import join, isfile, isdir, dirname
from time import time
from typing import Optional
from ovos_utils.log import LOG
from ovos_utils.xdg_utils import xdg_cache_home

Expand Down Expand Up @@ -84,6 +84,8 @@ def _get_token(backend_address: str, username: str = "guest",
raise ServerException(f"Error logging into {backend_address}. "
f"{resp.status_code}: {resp.text}")
_client_config = resp.json()
if not isdir(dirname(_client_config_path)):
makedirs(dirname(_client_config_path))
with open(_client_config_path, "w+") as f:
json.dump(_client_config, f, indent=2)

Expand Down
Loading