- fixed the parsing of the json files
- fixed the getDurationWithin(); was returning in ms not seconds
This commit is contained in:
parent
08d1667cb6
commit
9a14bbc919
4
utils.go
4
utils.go
|
@ -98,7 +98,7 @@ func readJSONFile(filename string) (map[string]string, error) {
|
||||||
return data, err
|
return data, err
|
||||||
}
|
}
|
||||||
// unmarshall the data
|
// unmarshall the data
|
||||||
err = json.Unmarshal(content, data)
|
err = json.Unmarshal(content, &data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return data, err
|
return data, err
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ func readYAMLFile(filename string) (map[string]string, error) {
|
||||||
// min : the smallest number we can accept
|
// min : the smallest number we can accept
|
||||||
// max : the largest number we can accept
|
// max : the largest number we can accept
|
||||||
func getDurationWithin(min, max int) time.Duration {
|
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
|
// getEnv checks to see if an environment variable exists otherwise uses the default
|
||||||
|
|
1
vault.go
1
vault.go
|
@ -89,6 +89,7 @@ func NewVaultService(url string) (*VaultService, error) {
|
||||||
if service.token, err = service.authenticate(options.vaultAuthOptions); err != nil {
|
if service.token, err = service.authenticate(options.vaultAuthOptions); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// step: set the token for the client
|
// step: set the token for the client
|
||||||
service.client.SetToken(service.token)
|
service.client.SetToken(service.token)
|
||||||
|
|
||||||
|
|
Reference in a new issue