update connection settings when changing hosts in cli

pull/6986/head
Cory LaNou 2016-07-08 11:31:54 -05:00
parent 11d141ae1f
commit 8871f5bf8c
2 changed files with 8 additions and 0 deletions

View File

@ -88,6 +88,7 @@ With this release the systemd configuration files for InfluxDB will use the syst
- [#6942](https://github.com/influxdata/influxdb/pull/6942): Fix panic: truncate the slice when merging the caches.
- [#6708](https://github.com/influxdata/influxdb/issues/6708): Drop writes from before the retention policy time window.
- [#6968](https://github.com/influxdata/influxdb/issues/6968): Always use the demo config when outputting a new config.
- [#6986](https://github.com/influxdata/influxdb/pull/6986): update connection settings when changing hosts in cli.
## v0.13.0 [2016-05-12]

View File

@ -292,6 +292,13 @@ func (c *CommandLine) Connect(cmd string) error {
return fmt.Errorf("Failed to connect to %s\n", c.Client.Addr())
}
c.ServerVersion = v
// Update the command with the current connection information
if h, p, err := net.SplitHostPort(config.URL.Host); err == nil {
c.Host = h
if i, err := strconv.Atoi(p); err == nil {
c.Port = i
}
}
return nil
}