summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2011-02-03 19:53:32 +0100
committerDavid Sommerseth <davids@redhat.com>2011-02-03 19:53:32 +0100
commitaa859529279b695fd6f7ebd5a2f66e42aa7bc066 (patch)
treeb8e6f17a71b0d91a0337df6112fe0745a04040fa
parentacb98887895b7c598436e12ac9ad5fc4cbae27a9 (diff)
downloadrteval-aa859529279b695fd6f7ebd5a2f66e42aa7bc066.tar.gz
rteval-aa859529279b695fd6f7ebd5a2f66e42aa7bc066.tar.xz
rteval-aa859529279b695fd6f7ebd5a2f66e42aa7bc066.zip
Don't return None values in the database_status() method
That just makes the XML-RPC serialiser grumpy. Return "something" instead of None. Signed-off-by: David Sommerseth <davids@redhat.com>
-rw-r--r--server/rtevaldb.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/rtevaldb.py b/server/rtevaldb.py
index 7a0ccaf..e778358 100644
--- a/server/rtevaldb.py
+++ b/server/rtevaldb.py
@@ -66,9 +66,11 @@ def database_status(config, debug=False, noaction=False):
return {"status": "Could not query database pgsql://%s:%s/%s" % (config.db_server,
config.db_port,
config.database)}
+ last_rterid = res['records'][0][1] and res['records'][0][1] or "(None)"
+ last_submid = res['records'][0][1] and res['records'][0][2] or "(None)"
return {"status": "OK",
"server_time": res['records'][0][0],
- "last_rterid": res['records'][0][1],
- "last_submid": res['records'][0][2]
+ "last_rterid": last_rterid,
+ "last_submid": last_submid
}