If lease_duration is not zero, output it even if there is no lease.

This commit is contained in:
Jeff Mitchell 2015-09-20 08:30:08 -04:00
parent a439b483f5
commit b0c97f8b8d

View File

@ -47,8 +47,12 @@ func outputFormatTable(ui cli.Ui, s *api.Secret, whitespace bool) int {
if s.LeaseID != "" && s.LeaseDuration > 0 {
input = append(input, fmt.Sprintf("lease_id %s %s", config.Delim, s.LeaseID))
}
if s.LeaseDuration > 0 {
input = append(input, fmt.Sprintf(
"lease_duration %s %d", config.Delim, s.LeaseDuration))
}
if s.LeaseID != "" && s.LeaseDuration > 0 {
input = append(input, fmt.Sprintf(
"lease_renewable %s %s", config.Delim, strconv.FormatBool(s.Renewable)))
}