From fc0bef724a3acdd92f942dca38749635934855c7 Mon Sep 17 00:00:00 2001 From: madz Date: Wed, 20 Jul 2016 20:16:11 +0800 Subject: [PATCH] clean up --- collectors/osd.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/collectors/osd.go b/collectors/osd.go index b360f9e..5729ad8 100644 --- a/collectors/osd.go +++ b/collectors/osd.go @@ -250,11 +250,7 @@ type cephOsdDump struct { } func (o *OsdCollector) collect() error { - cmd, err := o.cephOSDDfCommand() - - if err != nil { - return err - } + cmd := o.cephOSDDfCommand() buf, _, err := o.conn.MonCommand(cmd) if err != nil { @@ -446,15 +442,15 @@ func (o *OsdCollector) cephOsdDump() []byte { return cmd } -func (o *OsdCollector) cephOSDDfCommand() ([]byte, error) { +func (o *OsdCollector) cephOSDDfCommand() []byte { cmd, err := json.Marshal(map[string]interface{}{ "prefix": "osd df", "format": "json", }) if err != nil { - return nil, err + panic(err) } - return cmd, nil + return cmd } func (o *OsdCollector) cephOSDPerfCommand() []byte {