Fix a panic in snapshot inspect command
This commit is contained in:
parent
b6ca9d25ca
commit
fb464a8c0d
|
@ -59,6 +59,7 @@ func (c *cmd) Run(args []string) int {
|
||||||
meta, err := snapshot.Verify(f)
|
meta, err := snapshot.Verify(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.UI.Error(fmt.Sprintf("Error verifying snapshot: %s", err))
|
c.UI.Error(fmt.Sprintf("Error verifying snapshot: %s", err))
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
var b bytes.Buffer
|
var b bytes.Buffer
|
||||||
|
@ -70,6 +71,7 @@ func (c *cmd) Run(args []string) int {
|
||||||
fmt.Fprintf(tw, "Version\t%d\n", meta.Version)
|
fmt.Fprintf(tw, "Version\t%d\n", meta.Version)
|
||||||
if err = tw.Flush(); err != nil {
|
if err = tw.Flush(); err != nil {
|
||||||
c.UI.Error(fmt.Sprintf("Error rendering snapshot info: %s", err))
|
c.UI.Error(fmt.Sprintf("Error rendering snapshot info: %s", err))
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
c.UI.Info(b.String())
|
c.UI.Info(b.String())
|
||||||
|
|
Loading…
Reference in New Issue