From 9e0379d59f09e5fce504fc4b978339e62f5b5c51 Mon Sep 17 00:00:00 2001 From: Nick Daly Date: Wed, 13 Jun 2012 08:15:52 -0500 Subject: [PATCH] Clarified a few comments. --- ugly_hacks/santiago/santiago.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ugly_hacks/santiago/santiago.py b/ugly_hacks/santiago/santiago.py index e1ed32646..ca234356c 100644 --- a/ugly_hacks/santiago/santiago.py +++ b/ugly_hacks/santiago/santiago.py @@ -84,10 +84,13 @@ class Santiago(object): """ SUPPORTED_PROTOCOLS = set([1]) + # all keys must be present in the message. ALL_KEYS = set(("host", "client", "service", "locations", "reply_to", "request_version", "reply_versions")) + # required keys may not be null REQUIRED_KEYS = set(("client", "host", "service", "request_version", "reply_versions")) + # optional keys may be null. OPTIONAL_KEYS = ALL_KEYS ^ REQUIRED_KEYS LIST_KEYS = set(("reply_to", "locations", "reply_versions")) CONTROLLER_MODULE = "protocols.{0}.controller" @@ -386,9 +389,9 @@ class Santiago(object): debug_log("fail fingerprint {0}".format(str(request.fingerprint))) return - # copy out only white-listed keys from request, throwing away cruft + # copy out all white-listed keys from request, throwing away cruft request_body = dict() - source = json.loads((str(request))) + source = json.loads(str(request)) try: for key in Santiago.ALL_KEYS: request_body[key] = source[key]