From 37cba7ae03e5ba445748e36dbaa9089c413ce7c8 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 25 Mar 2020 10:39:52 +0200 Subject: [PATCH] Updated google csvStorage --- engine/storage_csv.go | 7 ++++++- packages/debian/changelog | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/storage_csv.go b/engine/storage_csv.go index c86fdb5b8b..8536745a59 100644 --- a/engine/storage_csv.go +++ b/engine/storage_csv.go @@ -728,7 +728,12 @@ func getClient(cfg *oauth2.Config, configPath string) (*http.Client, error) { if err != nil { return nil, err } - saveToken(string(config.CgrConfig().LoaderCgrCfg().GapiToken[1:len(config.CgrConfig().LoaderCgrCfg().GapiToken)-1]), tok) + path2TokFileb := config.CgrConfig().LoaderCgrCfg().GapiToken + path2TokFile := string(path2TokFileb[1 : len(path2TokFileb)-1]) + if err := os.MkdirAll(filepath.Dir(path2TokFile), os.FileMode(0777)); err != nil { // create the directory if not exists + return nil, err + } + saveToken(path2TokFile, tok) } else if err = json.Unmarshal(raw, tok); err != nil { return nil, err } diff --git a/packages/debian/changelog b/packages/debian/changelog index 619dfd5dce..a2ca188c00 100644 --- a/packages/debian/changelog +++ b/packages/debian/changelog @@ -36,6 +36,7 @@ cgrates (0.11.0~dev) UNRELEASED; urgency=medium * [DiameterAgent] Added RAR support * [Loader] Added support to load CSV files from URL * [Loader] Added configurable gapi_credentials + * [Loader] Added configurable gapi_token -- Alexandru Tripon Wed, 19 Feb 2020 13:25:52 +0200