From 2a056059c0e169ae9ce07c057549d13edb46a995 Mon Sep 17 00:00:00 2001 From: laharah Date: Sat, 4 Jun 2016 16:50:56 -0700 Subject: [PATCH] fix for wormhole-server count-* functions broken when we switched to dictfactory on db --- src/wormhole/server/cmd_usage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wormhole/server/cmd_usage.py b/src/wormhole/server/cmd_usage.py index 290a619..fd294e7 100644 --- a/src/wormhole/server/cmd_usage.py +++ b/src/wormhole/server/cmd_usage.py @@ -150,7 +150,7 @@ def count_channels(args): c_dict[key] = value OLD = time.time() - 10*60 def q(query, values=()): - return db.execute(query, values).fetchone()[0] + return list(db.execute(query, values).fetchone().values())[0] add("apps", q("SELECT COUNT(DISTINCT(`app_id`)) FROM `nameplates`")) add("total nameplates", q("SELECT COUNT() FROM `nameplates`")) @@ -196,7 +196,7 @@ def count_events(args): c_list.append((key, value)) c_dict[key] = value def q(query, values=()): - return db.execute(query, values).fetchone()[0] + return list(db.execute(query, values).fetchone().values())[0] add("apps", q("SELECT COUNT(DISTINCT(`app_id`)) FROM `nameplate_usage`"))