From 3c7a06bb8062657dba416085611fc7eb6d2e4168 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Tue, 24 Dec 2013 12:22:50 -0800 Subject: [PATCH] Add Datacenter to output --- command/agent/command.go | 11 ++++++----- command/agent/config.go | 9 +++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/command/agent/command.go b/command/agent/command.go index 46ef8bd6a6..79cbb6e96a 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -165,11 +165,12 @@ func (c *Command) Run(args []string) int { } c.Ui.Output("Consul agent running!") - c.Ui.Info(fmt.Sprintf("Node name: '%s'", config.NodeName)) - c.Ui.Info(fmt.Sprintf(" RPC addr: '%s'", config.RPCAddr)) - c.Ui.Info(fmt.Sprintf("HTTP addr: '%s'", config.HTTPAddr)) - c.Ui.Info(fmt.Sprintf("Encrypted: %#v", config.EncryptKey != "")) - c.Ui.Info(fmt.Sprintf(" Server: %v", config.Server)) + c.Ui.Info(fmt.Sprintf(" Node name: '%s'", config.NodeName)) + c.Ui.Info(fmt.Sprintf("Datacenter: '%s'", config.Datacenter)) + c.Ui.Info(fmt.Sprintf(" RPC addr: '%s'", config.RPCAddr)) + c.Ui.Info(fmt.Sprintf(" HTTP addr: '%s'", config.HTTPAddr)) + c.Ui.Info(fmt.Sprintf(" Encrypted: %#v", config.EncryptKey != "")) + c.Ui.Info(fmt.Sprintf(" Server: %v", config.Server)) // Enable log streaming c.Ui.Info("") diff --git a/command/agent/config.go b/command/agent/config.go index 7fe37f1ad2..66701757d6 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -74,10 +74,11 @@ type Config struct { // DefaultConfig is used to return a sane default configuration func DefaultConfig() *Config { return &Config{ - HTTPAddr: "127.0.0.1:8500", - LogLevel: "INFO", - RPCAddr: "127.0.0.1:8400", - Server: false, + Datacenter: consul.DefaultDC, + HTTPAddr: "127.0.0.1:8500", + LogLevel: "INFO", + RPCAddr: "127.0.0.1:8400", + Server: false, } }