Re: [Freeipa-devel] Why do we have so much duplicated code?

2010-01-27 Thread Jason Gerard DeRose
On Tue, 2010-01-26 at 18:55 -0500, John Dennis wrote:
 I constantly find identical code spread across multiple files. Is there 
 a reason for this code duplication? (Perhaps trying to keep import name 
 spaces isolated?)
 
 It seems to me code duplication is bad software practice for obvious 
 reasons.
 
 If there isn't a compelling design justification for the duplication can 
 we start moving some of this stuff to common libraries?

John, where's the duplication you're talking about?  We know there's a
lot of lingering duplication between the legacy code from v1 (ipapython,
the installer) and the new plugable v2 code (ipalib, ipaserver).  We've
slowly been migrating away from this legacy code, but the process
obviously isn't yet complete.

AFAIK, there isn't really any duplication within the v2 code itself, but
if you've spotted some, I'd like to know about it.



___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] Why do we have so much duplicated code?

2010-01-27 Thread Rob Crittenden

John Dennis wrote:
I constantly find identical code spread across multiple files. Is there 
a reason for this code duplication? (Perhaps trying to keep import name 
spaces isolated?)


No, we don't intentionally add duplicate code. Details would be helpful.



It seems to me code duplication is bad software practice for obvious 
reasons.


If there isn't a compelling design justification for the duplication can 
we start moving some of this stuff to common libraries?




Yes.

We did a tremendous amount of code reorganization many months ago, it is 
possible that some of this duplication is a result of that. There may be 
some dead code too. We completely replaced the entire XML-RPC subsystem 
but we didn't do it all at once, we slowly replaced it, so unused code 
may still exist as a result of that transition.


rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] Why do we have so much duplicated code?

2010-01-27 Thread John Dennis

On 01/27/2010 06:00 AM, Jason Gerard DeRose wrote:

On Tue, 2010-01-26 at 18:55 -0500, John Dennis wrote:

I constantly find identical code spread across multiple files. Is there
a reason for this code duplication? (Perhaps trying to keep import name
spaces isolated?)

It seems to me code duplication is bad software practice for obvious
reasons.

If there isn't a compelling design justification for the duplication can
we start moving some of this stuff to common libraries?


John, where's the duplication you're talking about?  We know there's a
lot of lingering duplication between the legacy code from v1 (ipapython,
the installer) and the new plugable v2 code (ipalib, ipaserver).  We've
slowly been migrating away from this legacy code, but the process
obviously isn't yet complete.

AFAIK, there isn't really any duplication within the v2 code itself, but
if you've spotted some, I'd like to know about it.


Well, you've helped answer one question, ipapython is deprecated, I 
didn't know that, what else is deprecated?


Is the contents of the source tree documented somewhere so one can tell 
what's supposed to be imported by what, what's the target goal, etc?


This isn't a complete list, just off the top of my head:

Duplicate functions:

client_auth_data_callback()
ipapython/nsslib.py
ipaserver/install/cainstance.py
ipaserver/install/certs.py
get_fqdn()
ipalib/util.py
ipaserver/install/installutils.py
get_gsserror()
ipapython/ipautil.py
ipaserver/ipautil.py
get_serial()
ipalib/plugins/cert.py
ipalib/plugins/service.py
needs_base64()
ipapython/ipautil.py
ipaserver/ipautil.py
openLocked()
contrib/RHEL4/ipachangeconf.py
ipa-client/ipaclient/ipachangeconf.py
realm_to_suffix()
ipalib/util.py
ipapython/ipautil.py
ipaserver/ipautil.py
unwrap_binary_data()
ipapython/ipautil.py
ipaserver/ipautil.py
utf8_encode_value()
ipapython/entity.py
ipaserver/ipautil.py
utf8_encode_values()
ipapython/entity.py
ipaserver/ipautil.py
validate_host()
ipalib/plugins/host.py
ipaserver/plugins/join.py
wrap_binary_data()
ipapython/ipautil.py
ipaserver/ipautil.py

Duplicate Classes:

class CIDict
ipapython/ipautil.py
ipaserver/ipautil.py
class IPAChangeConf
contrib/RHEL4/ipachangeconf.py
ipa-client/ipaclient/ipachangeconf.py
class SSLFile
ipalib/rpc.py
ipapython/ipasslfile.py
ipapython/nsslib.py

Logic for HTTP requests duplicated in:

nsslib.py
rpc.py
cainstance.py
ipapython/dogtag.py
plugins/dogtag.py
certs.py

--
John Dennis jden...@redhat.com

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


[Freeipa-devel] Why do we have so much duplicated code?

2010-01-26 Thread John Dennis
I constantly find identical code spread across multiple files. Is there 
a reason for this code duplication? (Perhaps trying to keep import name 
spaces isolated?)


It seems to me code duplication is bad software practice for obvious 
reasons.


If there isn't a compelling design justification for the duplication can 
we start moving some of this stuff to common libraries?


--
John Dennis jden...@redhat.com

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel