diff --git a/command/license.go b/command/license.go index ad67214c41fc..d9b2666c2368 100644 --- a/command/license.go +++ b/command/license.go @@ -70,7 +70,6 @@ func outputLicenseInfo(ui cli.Ui, lic *api.License, expired bool) { fmt.Sprintf("Customer ID|%s", lic.CustomerID), fmt.Sprintf("Issued At|%s", lic.IssueTime), expStr, - fmt.Sprintf("Terminates At|%s", lic.TerminationTime.String()), fmt.Sprintf("Datacenter|%s", lic.InstallationID), } ui.Output(formatKV(output)) diff --git a/command/license_get.go b/command/license_get.go index 91a4a1ca0d84..eff38d71334c 100644 --- a/command/license_get.go +++ b/command/license_get.go @@ -15,19 +15,13 @@ func (c *LicenseGetCommand) Help() string { helpText := ` Usage: nomad license get [options] - Gets a new license in Servers and Clients + Gets the license loaded by the server. The command is not forwarded to the + Nomad leader, and will return the license from the specific server being + contacted. When ACLs are enabled, this command requires a token with the 'operator:read' capability. - -stale=[true|false] - By default the license get command will be forwarded to the Nomad leader. - If -stale is set to true, the command will not be forwarded to the - leader and will return the license from the specific server being - contacted. This option may be useful during upgrade scenarios when a server - is given a new file license and is a follower so the new license has not - yet been propagated to raft. - General Options: ` + generalOptionsUsage(usageOptsDefault|usageOptsNoNamespace) @@ -36,10 +30,7 @@ General Options: } func (c *LicenseGetCommand) AutocompleteFlags() complete.Flags { - return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient), - complete.Flags{ - "-stale": complete.PredictAnything, - }) + return complete.Flags{} } func (c *LicenseGetCommand) AutocompleteArgs() complete.Predictor { @@ -53,13 +44,9 @@ func (c *LicenseGetCommand) Synopsis() string { func (c *LicenseGetCommand) Name() string { return "license get" } func (c *LicenseGetCommand) Run(args []string) int { - var stale bool - flags := c.Meta.FlagSet(c.Name(), FlagSetClient) flags.Usage = func() { c.Ui.Output(c.Help()) } - flags.BoolVar(&stale, "stale", false, "") - if err := flags.Parse(args); err != nil { c.Ui.Error(fmt.Sprintf("Error parsing flags: %s", err)) return 1 @@ -71,10 +58,7 @@ func (c *LicenseGetCommand) Run(args []string) int { return 1 } - q := &api.QueryOptions{ - AllowStale: stale, - } - resp, _, err := client.Operator().LicenseGet(q) + resp, _, err := client.Operator().LicenseGet(&api.QueryOptions{}) if err != nil { c.Ui.Error(fmt.Sprintf("Error getting license: %v", err)) return 1