[Freeipa-devel] [PATCH] convert SAFE_STRING_PATTERN (was: Why do we have so much duplicated code?)
John Dennis
jdennis at redhat.com
Thu Jan 28 14:18:49 UTC 2010
On 01/27/2010 10:30 PM, Rob Crittenden wrote:
> Is this code used by anything any more? This was part of the old XML-RPC
> server. It was used to determine whether a data type needed to be the
> XML-RPC Binary type or not. In v2 Jason wrote a similar function that
> bases the output type based on the python type (strings are unicode,
> binary data is str).
>
> So I think this can just be dropped (after testing to confirm, of course).
That's a great question. In fact this was one of the things which caused
me to spend time yesterday trying to figure out what's actually in use,
it's also an example of code that is duplicated identically in two places.
I don't think it's in use at all. I believe the functionality in
ipapython/ipautil.py and ipaserver/ipautil.py has been superseded by
xml_wrap and xml_unwrap in ipalib/rpc.py.
My vote would be to remove the code and I'll supply a patch which does.
FWIW SAFE_STRING_PATTERN can't exist in it's current form or I can't
submit my next patch for i18n support because the string causes xgettext
to abort.
It would be nice if we cleaned some of this legacy cruft out of the
source tree. Having not been involved in the code base continuously it
makes it confusing to figure out how pieces of the code fit together
when code isn't used and/or is defined in multiple places.
P.S.: sorry about about the format of the patch I submitted. I was
playing around with git send-email and it didn't work quite the way I
expected :-)
--
John Dennis <jdennis at redhat.com>
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
More information about the Freeipa-devel
mailing list