Merge pull request #7784 from influxdata/mr-meta-errors

Fix broken return statements swallowing errors
pull/7747/head
Mark Rushakoff 2017-01-03 09:27:57 -08:00 committed by GitHub
commit f715692d7a
3 changed files with 21 additions and 2 deletions

View File

@ -23,6 +23,7 @@ The stress tool `influx_stress` will be removed in a subsequent release. We reco
### Bugfixes
- [#7784](https://github.com/influxdata/influxdb/pull/7784): Fix broken error return on meta client's UpdateUser and DropContinuousQuery methods.
- [#7741](https://github.com/influxdata/influxdb/pull/7741): Fix string quoting and significantly improve performance of `influx_inspect export`.
- [#7698](https://github.com/influxdata/influxdb/pull/7698): CLI was caching db/rp for insert into statements.
- [#7659](https://github.com/influxdata/influxdb/issues/7659): Fix CLI import bug when using self-signed SSL certificates.

View File

@ -436,7 +436,7 @@ func (c *Client) UpdateUser(name, password string) error {
}
if err := data.UpdateUser(name, string(hash)); err != nil {
return nil
return err
}
delete(c.authCache, name)
@ -853,7 +853,7 @@ func (c *Client) DropContinuousQuery(database, name string) error {
data := c.cacheData.Clone()
if err := data.DropContinuousQuery(database, name); err != nil {
return nil
return err
}
if err := c.commit(data); err != nil {

View File

@ -680,6 +680,19 @@ func TestMetaClient_CreateUser(t *testing.T) {
}
}
func TestMetaClient_UpdateUser(t *testing.T) {
t.Parallel()
d, c := newClient()
defer os.RemoveAll(d)
defer c.Close()
// UpdateUser that doesn't exist should return an error.
if err := c.UpdateUser("foo", "bar"); err == nil {
t.Fatalf("expected error, got nil")
}
}
func TestMetaClient_ContinuousQueries(t *testing.T) {
t.Parallel()
@ -729,6 +742,11 @@ func TestMetaClient_ContinuousQueries(t *testing.T) {
if err := c.DropContinuousQuery("db0", "cq1"); err != nil {
t.Fatal(err)
}
// Dropping a nonexistent CQ should return an error.
if err := c.DropContinuousQuery("db0", "not-a-cq"); err == nil {
t.Fatal("expected an error, got nil")
}
}
func TestMetaClient_Subscriptions_Create(t *testing.T) {