From 712558db178b4599501f2d174d1ac85cf7bfe886 Mon Sep 17 00:00:00 2001 From: Anton Orel Date: Thu, 27 Feb 2014 18:42:29 +0400 Subject: [PATCH] Updated swift plugins --- plugins/swift/swift-async_ | 4 +++- plugins/swift/swift-dispersion | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/swift/swift-async_ b/plugins/swift/swift-async_ index 51d0c737..a39f7298 100755 --- a/plugins/swift/swift-async_ +++ b/plugins/swift/swift-async_ @@ -45,4 +45,6 @@ except IndexError: async_r = requests.get("http://%s:%s/recon/async" \ % (swift_server, os.getenv("SWIFT_OBJECT_PORT", "6000"))) -print "async_pending.value %d" % json.loads(async_r.text)['async_pending'] +async_r = json.loads(async_r.text)['async_pending'] +async_r = int(0 if async_r is None else async_r) +print "async_pending.value %d" % async_r diff --git a/plugins/swift/swift-dispersion b/plugins/swift/swift-dispersion index e512656d..08d10249 100755 --- a/plugins/swift/swift-dispersion +++ b/plugins/swift/swift-dispersion @@ -64,7 +64,7 @@ except IndexError: pass with os.popen("swift-dispersion-report -j %s" \ - % os.getenv("SWIFT_DISPERSION_CONFIG", "/etc/swift/swift.conf")) as report: + % os.getenv("SWIFT_DISPERSION_CONFIG", "/etc/swift/dispersion.conf")) as report: stats = json.load(report) for type_, values in stats.iteritems():