AUTHORS | 1 - func/minion/server.py | 11 ++--------- func/overlord/client.py | 4 +--- func/utils.py | 35 ----------------------------------- 4 files changed, 3 insertions(+), 48 deletions(-) New commits: commit 112f450e44d0f362ad13f6eb1b09319a92844690 Author: John Eckersberg <jeckersb@xxxxxxxxxx> Date: Thu May 13 14:35:45 2010 -0400 Revert "base64 encode all strings before transmitting over xmlrpc" This reverts commit e4038cc77a83e3d41487256aa06260326b8166d0. Conflicts: func/utils.py diff --git a/func/minion/server.py b/func/minion/server.py index 939415b..9a81168 100644 --- a/func/minion/server.py +++ b/func/minion/server.py @@ -204,14 +204,7 @@ class FuncApiMethod: rc = utils.nice_exception(t,v,tb) self.logger.debug("Return code for %s: %s" % (self.__name, rc)) - if self.__name == 'jobs.job_status': - # don't double-encode (which ultimately ends up being a no-op, - # since deep_base64(deep_base64(foo)) == foo - # the return value stored by jobthing is already encoded at this - # point - return rc - else: - return futils.deep_base64(rc) + return rc def serve(): diff --git a/func/overlord/client.py b/func/overlord/client.py index 527c9cc..85d1897 100644 --- a/func/overlord/client.py +++ b/func/overlord/client.py @@ -801,9 +801,7 @@ class Overlord(object): if self.interactive: print retval - - retval = func_utils.deep_base64(retval) - + except Exception, e: (t, v, tb) = sys.exc_info() retval = utils.nice_exception(t,v,tb) diff --git a/func/utils.py b/func/utils.py index e8aa789..632d727 100644 --- a/func/utils.py +++ b/func/utils.py @@ -177,34 +177,6 @@ def should_log(args): return True return False -def deep_base64(ds): - """ - Run through an arbitrary datastructure of dicts / lists / tuples - to find all strings and base 64 encode/decode them with - xmlrpclib.Binary objects. - """ - from xmlrpclib import Binary - - if isinstance(ds, Binary): - return ds.data - - if isinstance(ds, basestring): - return Binary(ds) - - if isinstance(ds, list) or isinstance(ds, tuple): - cleaned = map(lambda x: deep_base64(x), ds) - if isinstance(ds, tuple): - cleaned = tuple(cleaned) - return cleaned - - if isinstance(ds, dict): - cleaned = {} - for k,v in ds.iteritems(): - cleaned[deep_base64(k)] = deep_base64(v) - return cleaned - - return ds - _re_compiled_glob_match = None def re_glob(s): """ Tests if a string is a shell wildcard. """ commit a4f574ef2114f95350b3bfe2f152189e2447c6ad Author: John Eckersberg <jeckersb@xxxxxxxxxx> Date: Thu May 13 14:34:56 2010 -0400 Revert "encode tracebacks" This reverts commit a171dd6d0dc2ee098a8bfab30b6e413fc70f8217. diff --git a/func/minion/server.py b/func/minion/server.py index 0ee516e..939415b 100644 --- a/func/minion/server.py +++ b/func/minion/server.py @@ -331,7 +331,7 @@ class FuncSSLXMLRPCServer(AuthedXMLRPCServer.AuthedSSLXMLRPCServer, except: (t, v, tb) = sys.exc_info() rc = utils.nice_exception(t, v, tb) - return futils.deep_base64(rc) + return rc def auth_cb(self, request, client_address): peer_cert = request.get_peer_certificate() commit 81f1bdc4ff3d384918bda72ac6727bac4090bd0c Author: John Eckersberg <jeckersb@xxxxxxxxxx> Date: Thu May 13 14:34:45 2010 -0400 Revert "Backwards compatibility for xmlrpc Binary encoding" This reverts commit e5dcb8d9aa5ed9b8e24fc570c82c65fea43d7746. diff --git a/AUTHORS b/AUTHORS index 87fb8b8..8cfa477 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,7 +17,6 @@ Additional patches and contributions by ... Jasper Capel <capel@xxxxxxxxxxxx> Louis Coilliot <louis.coilliot@xxxxxxxxx> Eli Criffield <elicriffield@xxxxxxxxx> - Adam DeBuysscher <adebuyss@xxxxxxxxx> John Eckersberg <jeckersb@xxxxxxxxxx> Luca Foppiano <lfoppiano@xxxxxxxxxxxxx> Matt Hicks <mhicks@xxxxxxxxxx> diff --git a/func/overlord/client.py b/func/overlord/client.py index 64622c4..527c9cc 100644 --- a/func/overlord/client.py +++ b/func/overlord/client.py @@ -802,7 +802,7 @@ class Overlord(object): if self.interactive: print retval - retval = func_utils.deep_base64(retval,1) + retval = func_utils.deep_base64(retval) except Exception, e: (t, v, tb) = sys.exc_info() diff --git a/func/utils.py b/func/utils.py index a3fb18c..e8aa789 100644 --- a/func/utils.py +++ b/func/utils.py @@ -177,29 +177,22 @@ def should_log(args): return True return False -def deep_base64(ds, mode = 0): +def deep_base64(ds): """ Run through an arbitrary datastructure of dicts / lists / tuples to find all strings and base 64 encode/decode them with xmlrpclib.Binary objects. - - mode 0 - flip, 1 - force decode, 2 - force encode - """ from xmlrpclib import Binary if isinstance(ds, Binary): - if mode == 2: - return ds return ds.data if isinstance(ds, basestring): - if mode == 1: - return ds return Binary(ds) if isinstance(ds, list) or isinstance(ds, tuple): - cleaned = map(lambda x: deep_base64(x,mode), ds) + cleaned = map(lambda x: deep_base64(x), ds) if isinstance(ds, tuple): cleaned = tuple(cleaned) return cleaned @@ -207,7 +200,7 @@ def deep_base64(ds, mode = 0): if isinstance(ds, dict): cleaned = {} for k,v in ds.iteritems(): - cleaned[deep_base64(k)] = deep_base64(v,mode) + cleaned[deep_base64(k)] = deep_base64(v) return cleaned return ds _______________________________________________ Func-list mailing list Func-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/func-list