<commit_before>package main

import (
	"encoding/json"
	"flag"
	"fmt"
	"io"
	"log"
	"os"
	"path"

	"github.com/BurntSushi/toml"
	flags "github.com/jessevdk/go-flags"

	"github.ibm.com/almaden-containers/ubiquity-flexvolume/core"
	"github.ibm.com/almaden-containers/ubiquity/model"
	"github.ibm.com/almaden-containers/ubiquity/utils"
)

var configFile = flag.String(
	"configFile",
	"ubiquity-client.conf",
	"config file with ubiquity client configuration params",
)

type InitCommand struct {
	Init func() `short:"i" long:"init" description:"Initialize the plugin"`
}

func (i *InitCommand) Execute(args []string) error {
	var config model.UbiquityPluginConfig
	if _, err := toml.DecodeFile(*configFile, &config); err != nil {
		fmt.Printf("error decoding config file", err)
		return err
	}

	logger, logFile := setupLogger(config.LogPath)
	defer closeLogs(logFile)

	storageApiURL := fmt.Sprintf("http://%s:%d/ubiquity_storage", config.UbiquityServer.Address, config.UbiquityServer.Port)
	controller, err := core.NewController(logger, storageApiURL, config.Backend, config)
	if err != nil {
		response := model.FlexVolumeResponse{
			Status:  "Failure",
			Message: fmt.Sprintf("Failed tocreate controller %#v", err),
			Device:  "",
		}<commit_msg>Change config file default location<commit_after>package main

import (
	"encoding/json"
	"flag"
	"fmt"
	"io"
	"log"
	"os"
	"path"

	"github.com/BurntSushi/toml"
	flags "github.com/jessevdk/go-flags"

	"github.ibm.com/almaden-containers/ubiquity-flexvolume/core"
	"github.ibm.com/almaden-containers/ubiquity/model"
	"github.ibm.com/almaden-containers/ubiquity/utils"
)

var configFile = flag.String(
	"configFile",
	"/tmp/ubiquity-client.conf",
	"config file with ubiquity client configuration params",
)

type InitCommand struct {
	Init func() `short:"i" long:"init" description:"Initialize the plugin"`
}

func (i *InitCommand) Execute(args []string) error {
	var config model.UbiquityPluginConfig
	if _, err := toml.DecodeFile(*configFile, &config); err != nil {
		fmt.Printf("error decoding config file", err)
		return err
	}

	logger, logFile := setupLogger(config.LogPath)
	defer closeLogs(logFile)

	storageApiURL := fmt.Sprintf("http://%s:%d/ubiquity_storage", config.UbiquityServer.Address, config.UbiquityServer.Port)
	controller, err := core.NewController(logger, storageApiURL, config.Backend, config)
	if err != nil {
		response := model.FlexVolumeResponse{
			Status:  "Failure",
			Message: fmt.Sprintf("Failed tocreate controller %#v", err),
			Device:  "",
		}
{'fraction_non_alphanumeric': 0.14246141669964385, 'fraction_numerical': 0.0, 'mean_word_length': 5.062350119904076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7157254', 'n_tokens_mistral': 930, 'n_tokens_neox': 875, 'n_words': 182}