From 30dae56d353d324e97e13a47891c30f384a66be9 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Wed, 25 Apr 2018 12:16:15 -0700 Subject: Quorum client creates its data folder before write Data folder is not guaranteed to exist and therefore needs to be created before writes can be done on it. Issue-ID: AAF-261 Change-Id: I4671f0dac34a04c80639386719639b8c9472a9d3 Signed-off-by: Kiran Kamineni --- sms-service/src/quorumclient/quorumclient.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'sms-service') diff --git a/sms-service/src/quorumclient/quorumclient.go b/sms-service/src/quorumclient/quorumclient.go index dfa1a26..51dfc9c 100644 --- a/sms-service/src/quorumclient/quorumclient.go +++ b/sms-service/src/quorumclient/quorumclient.go @@ -64,11 +64,14 @@ func loadPGPKeys(prKeyPath string, pbKeyPath string) (string, string, error) { //calls necessary initialization endpoints on the //SMS webservice func main() { - podName := os.Getenv("HOSTNAME") - idFilePath := filepath.Join("auth", podName, "id") - pbKeyPath := filepath.Join("auth", podName, "pbkey") - prKeyPath := filepath.Join("auth", podName, "prkey") - shardPath := filepath.Join("auth", podName, "shard") + folderName := os.Getenv("HOSTNAME") + //Make sure to create the folder. It is not guaranteed to exist + os.MkdirAll(folderName, 0700) + + idFilePath := filepath.Join("auth", folderName, "id") + pbKeyPath := filepath.Join("auth", folderName, "pbkey") + prKeyPath := filepath.Join("auth", folderName, "prkey") + shardPath := filepath.Join("auth", folderName, "shard") smslogger.Init("quorum.log") smslogger.WriteInfo("Starting Log for Quorum Client") -- cgit 1.2.3-korg