Username not set for mqtt_consumer plugin

Username parameter for the mqtt_consumer plugin was not pass to the client because an incorrect empty check.

closes #781
This commit is contained in:
Pascal Larin 2016-03-02 12:36:23 -05:00 committed by Cameron Sparr
parent ed9937bbd8
commit 8464be691e
2 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@
- [#748](https://github.com/influxdata/telegraf/issues/748): Fix sensor plugin split on ":" - [#748](https://github.com/influxdata/telegraf/issues/748): Fix sensor plugin split on ":"
- [#722](https://github.com/influxdata/telegraf/pull/722): Librato output plugin fixes. Thanks @chrusty! - [#722](https://github.com/influxdata/telegraf/pull/722): Librato output plugin fixes. Thanks @chrusty!
- [#745](https://github.com/influxdata/telegraf/issues/745): Fix Telegraf toml parse panic on large config files. Thanks @titilambert! - [#745](https://github.com/influxdata/telegraf/issues/745): Fix Telegraf toml parse panic on large config files. Thanks @titilambert!
- [#781](https://github.com/influxdata/telegraf/pull/781): Fix mqtt_consumer username not being set. Thanks @chaton78!
## v0.10.4.1 ## v0.10.4.1

View File

@ -181,7 +181,7 @@ func (m *MQTTConsumer) createOpts() (*mqtt.ClientOptions, error) {
} }
user := m.Username user := m.Username
if user == "" { if user != "" {
opts.SetUsername(user) opts.SetUsername(user)
} }
password := m.Password password := m.Password