Normalize objectclass attribute values (#5423)

Authored by machniak on May 11 2016, 3:00 PM.


Diff Detail

rP pykolab
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

machniak updated this revision to Diff 343.May 11 2016, 3:00 PM
machniak retitled this revision from to Normalize objectclass attribute values (#5423).
machniak updated this object.
machniak edited the test plan for this revision. (Show Details)
machniak added a reviewer: PyKolab Developers.

We already added this code snipet to our test system and run a huge "sync --resync" which seams to add users which where not added earlier.
So I'd like to say we tested it intensively and feel real good with this patch. It's working as intended.

vanmeeuwen requested changes to this revision.May 13 2016, 10:56 AM
vanmeeuwen added a reviewer: vanmeeuwen.
vanmeeuwen added a subscriber: vanmeeuwen.
vanmeeuwen added inline comments.

This isn't generally our coding style -- difficult to read.

This can just be:

if not result.has_key('objectclass'):
  result['objectclass'] = []

if result['objectclass'] is None:
  result['objectclass'] = []

if not isinstance(result['objectclass'], list):
  result['objectclass'] = [result['objectclass']]

result['objectclass'] = [x.lower() for x in result['objectclass']]
This revision now requires changes to proceed.May 13 2016, 10:56 AM
machniak updated this revision to Diff 353.May 16 2016, 12:41 PM
machniak edited edge metadata.

Fix code style

vanmeeuwen accepted this revision.May 18 2016, 9:37 AM
vanmeeuwen edited edge metadata.
This revision is now accepted and ready to land.May 18 2016, 9:37 AM
This revision was automatically updated to reflect the committed changes.