From 0cf2e605aee730a64974fda434a37ba920d1d98d Mon Sep 17 00:00:00 2001 From: Manuel Sangoi Date: Thu, 3 Mar 2016 14:14:50 +0100 Subject: [PATCH] Do not ignore username option for mqtt output --- CHANGELOG.md | 1 + plugins/outputs/mqtt/mqtt.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02ddbc647..47bd2e256 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - [#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! - [#781](https://github.com/influxdata/telegraf/pull/781): Fix mqtt_consumer username not being set. Thanks @chaton78! +- [#786](https://github.com/influxdata/telegraf/pull/786): Fix mqtt output username not being set. Thanks @msangoi! ## v0.10.4.1 diff --git a/plugins/outputs/mqtt/mqtt.go b/plugins/outputs/mqtt/mqtt.go index 6f8abe954..10c1b1a9e 100644 --- a/plugins/outputs/mqtt/mqtt.go +++ b/plugins/outputs/mqtt/mqtt.go @@ -172,7 +172,7 @@ func (m *MQTT) createOpts() (*paho.ClientOptions, error) { } user := m.Username - if user == "" { + if user != "" { opts.SetUsername(user) } password := m.Password