mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Rename id to path and path to file_path, print audit backend paths
This commit is contained in:
@@ -19,10 +19,10 @@ type AuditEnableCommand struct {
|
||||
}
|
||||
|
||||
func (c *AuditEnableCommand) Run(args []string) int {
|
||||
var desc, id string
|
||||
var desc, path string
|
||||
flags := c.Meta.FlagSet("audit-enable", FlagSetDefault)
|
||||
flags.StringVar(&desc, "description", "", "")
|
||||
flags.StringVar(&id, "id", "", "")
|
||||
flags.StringVar(&path, "path", "", "")
|
||||
flags.Usage = func() { c.Ui.Error(c.Help()) }
|
||||
if err := flags.Parse(args); err != nil {
|
||||
return 1
|
||||
@@ -37,8 +37,8 @@ func (c *AuditEnableCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
auditType := args[0]
|
||||
if id == "" {
|
||||
id = auditType
|
||||
if path == "" {
|
||||
path = auditType
|
||||
}
|
||||
|
||||
// Build the options
|
||||
@@ -67,7 +67,7 @@ func (c *AuditEnableCommand) Run(args []string) int {
|
||||
return 1
|
||||
}
|
||||
|
||||
err = client.Sys().EnableAudit(id, auditType, desc, opts)
|
||||
err = client.Sys().EnableAudit(path, auditType, desc, opts)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf(
|
||||
"Error enabling audit backend: %s", err))
|
||||
@@ -75,7 +75,7 @@ func (c *AuditEnableCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
c.Ui.Output(fmt.Sprintf(
|
||||
"Successfully enabled audit backend '%s'!", auditType))
|
||||
"Successfully enabled audit backend '%s' with path '%s'!", auditType, path))
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ Audit Enable Options:
|
||||
-description=<desc> A human-friendly description for the backend. This
|
||||
shows up only when querying the enabled backends.
|
||||
|
||||
-id=<id> Specify a unique ID for this audit backend. This
|
||||
-path=<path> Specify a unique path for this audit backend. This
|
||||
is purely for referencing this audit backend. By
|
||||
default this will be the backend type.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user