1
0
Fork 0
mirror of https://github.com/Luzifer/yaml-vault.git synced 2024-10-18 06:44:25 +00:00

fix bug when reading path and key with same name

This commit is contained in:
Knut Ahlers 2016-07-11 17:43:43 +02:00
parent a256f9988b
commit 8f66b08d02
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 16 additions and 12 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
vault.yaml
yaml-vault

View file

@ -139,6 +139,7 @@ func exportFromVault(client *api.Client) error {
}
func readRecurse(client *api.Client, path string, out *importFile) error {
if strings.HasSuffix(path, "/") {
secret, err := client.Logical().List(path)
if err != nil {
return fmt.Errorf("Error reading %s: %s", path, err)
@ -152,8 +153,9 @@ func readRecurse(client *api.Client, path string, out *importFile) error {
}
return nil
}
}
secret, err = client.Logical().Read(path)
secret, err := client.Logical().Read(path)
if err != nil {
return err
}