Skip to content

Commit

Permalink
Merge pull request #6986 from influxdata/cjl-update-connection-settin…
Browse files Browse the repository at this point in the history
…gs-cli

update connection settings when changing hosts in cli
  • Loading branch information
corylanou committed Jul 10, 2016
2 parents 11d141a + 8871f5b commit 921e4f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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]

Expand Down
7 changes: 7 additions & 0 deletions cmd/influx/cli/cli.go
Expand Up @@ -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
}
Expand Down

0 comments on commit 921e4f5

Please sign in to comment.