command: can force address

This commit is contained in:
Mitchell Hashimoto
2015-04-12 17:30:19 -07:00
parent 8f12a29b1e
commit 46cfb9eb97

View File

@@ -31,6 +31,7 @@ const (
// Meta contains the meta-options and functionality that nearly every
// Vault command inherits.
type Meta struct {
Address string // Address to force for API clients
ClientToken string
Ui cli.Ui
@@ -55,6 +56,9 @@ func (m *Meta) Client() (*api.Client, error) {
if m.flagAddress != "" {
config.Address = m.flagAddress
}
if m.Address != "" {
config.Address = m.Address
}
// If we need custom TLS configuration, then set it
if m.flagCACert != "" || m.flagCAPath != "" || m.flagInsecure {