from .config import LDAPMigrationConfiguration
-__version__ = '0.9.0'
+__version__ = '0.9.1'
LOG = logging.getLogger(__name__)
CFG_BASENAME = 'ldap-migration.ini'
msg = msg.format(at=attribute_name, dn=src_dn)
LOG.debug(msg)
continue
+ if ('obsolete' in self.attribute_types[attribute_name] and
+ self.attribute_types[attribute_name]['obsolete']):
+ if self.verbose > 1:
+ msg = "AttributeType {at!r} of sorce entry {dn!r} is obsolete.".format(
+ at=attribute_name, dn=src_dn)
+ LOG.debug(msg)
+ continue
tgt_at_name = self.attribute_types.real_key(attribute_name)
- target_entry[tgt_at_name] = copy.copy(src_entry['attributes'][attribute_name])
+ src_attr = src_entry['attributes'][attribute_name]
+ if isinstance(src_attr, list):
+ for single_attr in src_attr:
+ if single_attr == '':
+ continue
+ if tgt_at_name not in target_entry:
+ target_entry[tgt_at_name] = []
+ target_entry[tgt_at_name].append(single_attr)
+ else:
+ if src_attr != '':
+ target_entry[tgt_at_name] = src_attr
if ('sunservice' in used_classes) or ('sunServiceComponent' in used_classes):
if 'organizationalUnit' not in used_classes:
for src_oc_name in src_entry['attributes'][src_at_name]:
src_obj_classes[src_oc_name] = 0
else:
- src_attributes[src_at_name] = copy.copy(src_entry['attributes'][src_at_name])
+ if ('obsolete' in self.attribute_types[src_at_name] and
+ self.attribute_types[src_at_name]['obsolete']):
+ if self.verbose > 1:
+ msg = "AttributeType {at!r} of sorce entry {dn!r} is obsolete.".format(
+ at=src_at_name, dn=src_dn)
+ LOG.debug(msg)
+ continue
+ src_attr = src_entry['attributes'][src_at_name]
+ if isinstance(src_attr, list):
+ for single_attr in src_attr:
+ if single_attr == '':
+ continue
+ if src_at_name not in src_attributes:
+ src_attributes[src_at_name] = []
+ src_attributes[src_at_name].append(single_attr)
+ else:
+ if src_attr != '':
+ src_attributes[src_at_name] = src_attr
for tgt_at_name in tgt_entry['attributes']:
return changes
self.count_unchanged += 1
- if self.verbose:
- msg = "No changes on target entry {tdn!r} necessary.".format(tdn=tgt_dn)
- LOG.info(msg)
return None
# -------------------------------------------------------------------------
self.write_result_file(fh, tgt_dn, '+')
return True
else:
+ if self.verbose:
+ msg = "No changes on target entry {tdn!r} necessary.".format(tdn=tgt_dn)
+ LOG.info(msg)
self.write_result_file(fh, tgt_dn, ' ')
return False