Improve unseal CLI message

This commit is contained in:
Ian Unruh
2015-05-19 00:34:18 -07:00
parent cce15445c9
commit 045b5a9c84

View File

@@ -33,6 +33,18 @@ func (c *UnsealCommand) Run(args []string) int {
return 2
}
sealStatus, err := client.Sys().SealStatus()
if err != nil {
c.Ui.Error(fmt.Sprintf(
"Error checking seal status: %s", err))
return 2
}
if !sealStatus.Sealed {
c.Ui.Output("Vault is already unsealed.")
return 0
}
args = flags.Args()
value := c.Key