Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/ldif.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,23 @@ def _unparse_entry_record(self, entry):
"""
:type entry: Dict[string, List[string]]
:param entry: Dictionary holding an entry

Process "changetype" attribute first if it exists and then rest of attributes
"""
for attr_type in entry.keys():
keys = list(entry.keys())

for attr_type in keys:
if isinstance(attr_type, str) and "changetype" in attr_type.lower():
for attr_value in entry[attr_type]:
self._unparse_attr("changetype", attr_value)

for attr_type in keys:
if attr_type.lower() == "changetype":
continue
for attr_value in entry[attr_type]:
self._unparse_attr(attr_type, attr_value)


def _unparse_changetype(self, mod_len):
"""Detect and write the changetype."""
if mod_len == 2:
Expand Down