Merge pull request #2185 from richard-hulm/issue-1404

Add the version (from config) to the Starting Consul Agent printout
This commit is contained in:
James Phillips 2016-07-19 13:56:53 -07:00 committed by GitHub
commit dab7905cab

View file

@ -406,7 +406,19 @@ func (c *Command) setupLoggers(config *Config) (*GatedWriter, *logWriter, io.Wri
// setupAgent is used to start the agent and various interfaces // setupAgent is used to start the agent and various interfaces
func (c *Command) setupAgent(config *Config, logOutput io.Writer, logWriter *logWriter) error { func (c *Command) setupAgent(config *Config, logOutput io.Writer, logWriter *logWriter) error {
c.Ui.Output("Starting Consul agent...") var version string
version = "v" + config.Version
if len(config.VersionPrerelease) != 0 {
version += " " + config.VersionPrerelease
if len(config.Revision) != 0 {
version += " " + config.Revision
}
}
c.Ui.Output("Starting Consul agent (" + version + ")...")
agent, err := Create(config, logOutput) agent, err := Create(config, logOutput)
if err != nil { if err != nil {
c.Ui.Error(fmt.Sprintf("Error starting agent: %s", err)) c.Ui.Error(fmt.Sprintf("Error starting agent: %s", err))