From 3875fb97bb4edd65be75da3a01a4a2e25d6ff456 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Dec 2016 12:56:41 +0000 Subject: [PATCH 1/3] CSupport ceph user other than admin --- exporter.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exporter.go b/exporter.go index 66cced6..f3ce5b4 100644 --- a/exporter.go +++ b/exporter.go @@ -81,10 +81,11 @@ func main() { metricsPath = flag.String("telemetry.path", "/metrics", "URL path for surfacing collected metrics") cephConfig = flag.String("ceph.config", "", "path to ceph config file") + cephUser = flag.String("ceph.user", "admin", "Ceph user to connect to cluster. The key file must be named ceph.client..keyring.") ) flag.Parse() - conn, err := rados.NewConn() + conn, err := rados.NewConnWithUser(*cephUser) if err != nil { log.Fatalf("cannot create new ceph connection: %s", err) } From 5451d4c28d69f0e56a959824f9a9eb874dc0cd91 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Dec 2016 14:27:54 +0000 Subject: [PATCH 2/3] Gofmt --- exporter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter.go b/exporter.go index f3ce5b4..16f4ee2 100644 --- a/exporter.go +++ b/exporter.go @@ -81,7 +81,7 @@ func main() { metricsPath = flag.String("telemetry.path", "/metrics", "URL path for surfacing collected metrics") cephConfig = flag.String("ceph.config", "", "path to ceph config file") - cephUser = flag.String("ceph.user", "admin", "Ceph user to connect to cluster. The key file must be named ceph.client..keyring.") + cephUser = flag.String("ceph.user", "admin", "Ceph user to connect to cluster. The key file must be named ceph.client..keyring.") ) flag.Parse() From e921602291aa3f34c00bacdb9fc8e933c946cb94 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Dec 2016 14:31:37 +0000 Subject: [PATCH 3/3] Remove unecessary flag usage --- exporter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter.go b/exporter.go index 16f4ee2..0051bda 100644 --- a/exporter.go +++ b/exporter.go @@ -81,7 +81,7 @@ func main() { metricsPath = flag.String("telemetry.path", "/metrics", "URL path for surfacing collected metrics") cephConfig = flag.String("ceph.config", "", "path to ceph config file") - cephUser = flag.String("ceph.user", "admin", "Ceph user to connect to cluster. The key file must be named ceph.client..keyring.") + cephUser = flag.String("ceph.user", "admin", "Ceph user to connect to cluster.") ) flag.Parse()