From 19057a3593e35cf94290991d0d44751adc871b34 Mon Sep 17 00:00:00 2001 From: babbleshack Date: Thu, 9 Jul 2015 14:04:40 +0100 Subject: [PATCH 1/2] added shell=True to subprocess.check_return call --- modules/dc_collectd/files/ceph/ceph_iops_plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/dc_collectd/files/ceph/ceph_iops_plugin.py b/modules/dc_collectd/files/ceph/ceph_iops_plugin.py index b332ece11..1d3d482f7 100644 --- a/modules/dc_collectd/files/ceph/ceph_iops_plugin.py +++ b/modules/dc_collectd/files/ceph/ceph_iops_plugin.py @@ -13,7 +13,9 @@ def get_stats(self): ceph_cluster = "%s-%s" % (self.prefix, self.cluster) data = {ceph_cluster:{'health': {'iops':0}}} try: - output = subprocess.check_output(['ceph', '-s', '--format', 'json']) + output = subprocess.check_output(['ceph', '-s', '--format', 'json'], + shell=True + ) except subprocess.CalledProcessError as exc: collectd.error( "ceph-iops: failed to ceph -s :: Output is %s :: error code %i" From fbc90d5f4babd1097c9f8d7ff423f16cb9b2e1d1 Mon Sep 17 00:00:00 2001 From: babbleshack Date: Thu, 9 Jul 2015 14:58:18 +0100 Subject: [PATCH 2/2] changed array to string in subprocess call --- modules/dc_collectd/files/ceph/ceph_iops_plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/dc_collectd/files/ceph/ceph_iops_plugin.py b/modules/dc_collectd/files/ceph/ceph_iops_plugin.py index 1d3d482f7..16e3128d5 100644 --- a/modules/dc_collectd/files/ceph/ceph_iops_plugin.py +++ b/modules/dc_collectd/files/ceph/ceph_iops_plugin.py @@ -13,8 +13,8 @@ def get_stats(self): ceph_cluster = "%s-%s" % (self.prefix, self.cluster) data = {ceph_cluster:{'health': {'iops':0}}} try: - output = subprocess.check_output(['ceph', '-s', '--format', 'json'], - shell=True + output = subprocess.check_output('ceph -s --format json', + shell=True ) except subprocess.CalledProcessError as exc: collectd.error(