Skip to content

Commit

Permalink
Merge pull request #206 from karimra/set-json-ietf-enc
Browse files Browse the repository at this point in the history
fix set cmd behavior with --encoding flag
  • Loading branch information
karimra authored Oct 26, 2020
2 parents 7512c91 + 1130f4f commit 6aac40f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func createSetRequest() (*gnmi.SetRequest, error) {
return nil, fmt.Errorf("encoding: %s not supported together with file values", viper.GetString("encoding"))
}
} else {
err = setValue(value, "json", setInput.updateValues[i])
err = setValue(value, strings.ToLower(viper.GetString("encoding")), setInput.updateValues[i])
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -352,7 +352,7 @@ func createSetRequest() (*gnmi.SetRequest, error) {
return nil, fmt.Errorf("encoding: %s not supported together with file values", viper.GetString("encoding"))
}
} else {
err = setValue(value, "json", setInput.replaceValues[i])
err = setValue(value, strings.ToLower(viper.GetString("encoding")), setInput.replaceValues[i])
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 6aac40f

Please sign in to comment.