From 1397fa799b64cc259a9a1b1b70b7b048f2182837 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Mon, 26 Sep 2011 15:30:18 +0200 Subject: Fix swift-recon Make sure there is things in the row of ring_data.devs. Adjust else: for the driver information. Change-Id: I11a949dfa3f36691f86f3b7330d65e435c22da24 --- bin/swift-recon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/swift-recon') diff --git a/bin/swift-recon b/bin/swift-recon index 4750ea064..8df268dae 100755 --- a/bin/swift-recon +++ b/bin/swift-recon @@ -22,7 +22,7 @@ def getdevices(): #todo , fitler by zone[s] ring_file = "/etc/swift/object.ring.gz" ring_data = Ring(ring_file) - ips = set((n['ip'], n['port']) for n in ring_data.devs) + ips = set((n['ip'], n['port']) for n in ring_data.devs if n) return ips @@ -269,7 +269,7 @@ def disk_usage(): averages.append(average) for percent in stats[url]: percents[percent] = percents.get(percent, 0) + 1 - else: + else: print "-> %s: Error. No drive info available." % url if len(lows) > 0: -- cgit v1.2.1