Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update connection settings when changing hosts in cli #6986

Merged
merged 1 commit into from
Jul 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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