Merge pull request #1427 from hashicorp/refresh-interval

Rename lease_duration to refresh_interval when there is no lease ID, …
This commit is contained in:
Jeff Mitchell 2016-05-17 13:39:56 -04:00
commit 2adbe112be

View file

@ -129,12 +129,17 @@ func (t TableFormatter) OutputSecret(ui cli.Ui, secret, s *api.Secret) error {
input = append(input, fmt.Sprintf("Key %s Value", config.Delim))
input = append(input, fmt.Sprintf("--- %s -----", config.Delim))
if s.LeaseDuration > 0 {
if s.LeaseID != "" {
input = append(input, fmt.Sprintf("lease_id %s %s", config.Delim, s.LeaseID))
input = append(input, fmt.Sprintf(
"lease_duration %s %d", config.Delim, s.LeaseDuration))
} else {
input = append(input, fmt.Sprintf(
"refresh_interval %s %d", config.Delim, s.LeaseDuration))
}
input = append(input, fmt.Sprintf(
"lease_duration %s %d", config.Delim, s.LeaseDuration))
if s.LeaseID != "" {
input = append(input, fmt.Sprintf(
"lease_renewable %s %s", config.Delim, strconv.FormatBool(s.Renewable)))