Merge pull request #224 from ianunruh/feature/unseal-msg

Improve unseal CLI message
This commit is contained in:
Armon Dadgar 2015-05-19 11:33:23 -07:00
commit 4981b8de29
1 changed files with 12 additions and 0 deletions

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