From b0c97f8b8d2863348337ffdbbb9e7ea214d850db Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Sun, 20 Sep 2015 08:30:08 -0400 Subject: [PATCH] If lease_duration is not zero, output it even if there is no lease. --- command/format.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command/format.go b/command/format.go index 0b6aa7d968..61c04b1505 100644 --- a/command/format.go +++ b/command/format.go @@ -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))) }