- fixed the parsing of the json files

- fixed the getDurationWithin(); was returning in ms not seconds
This commit is contained in:
Rohith 2015-10-14 16:04:22 +01:00
parent 08d1667cb6
commit 9a14bbc919
2 changed files with 3 additions and 2 deletions

View file

@ -98,7 +98,7 @@ func readJSONFile(filename string) (map[string]string, error) {
return data, err
}
// unmarshall the data
err = json.Unmarshal(content, data)
err = json.Unmarshal(content, &data)
if err != nil {
return data, err
}
@ -126,7 +126,7 @@ func readYAMLFile(filename string) (map[string]string, error) {
// min : the smallest number we can accept
// max : the largest number we can accept
func getDurationWithin(min, max int) time.Duration {
return time.Duration(rand.Intn(max-min) + min)
return time.Duration(rand.Intn(max-min) + min) * time.Second
}
// getEnv checks to see if an environment variable exists otherwise uses the default

View file

@ -89,6 +89,7 @@ func NewVaultService(url string) (*VaultService, error) {
if service.token, err = service.authenticate(options.vaultAuthOptions); err != nil {
return nil, err
}
// step: set the token for the client
service.client.SetToken(service.token)