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
1 changed files with 13 additions and 1 deletions

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
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)
if err != nil {
c.Ui.Error(fmt.Sprintf("Error starting agent: %s", err))