diff --git a/plsc_flat.py b/plsc_flat.py index 91b6993..f02a54f 100755 --- a/plsc_flat.py +++ b/plsc_flat.py @@ -54,6 +54,7 @@ def create(src, dst): src_dn = src.rfind(f"o={co_id},dc=ordered,dc={service}", '(ObjectClass=organization)') src_co = src_dn.get(f"o={co_id},dc=ordered,dc={service},{src.basedn}", {}) src_mail = src_co.get('mail', []) + src_status = src_co.get('organizationalStatus', ['active']) logging.debug(f"src_mail: {src_mail}") co_dn = f"dc=flat,dc={service},{dst.basedn}" @@ -106,6 +107,7 @@ def create(src, dst): new_entry['cn'] = [grp_cn] new_entry['member'] = members new_entry['mail'] = src_mail + new_entry['organizationalStatus'] = src_status dst_dn = f"cn={grp_cn},ou=Groups,{co_dn}" diff --git a/plsc_ordered.py b/plsc_ordered.py index 131763d..644fe3c 100755 --- a/plsc_ordered.py +++ b/plsc_ordered.py @@ -225,6 +225,7 @@ def create(src, dst): co_entry['businessCategory'] = add_scope(values=co.get('tags'), scope=co['organisation']['short_name']) co_entry['mail'] = list(set(admin.get('email') for admin in co.get('admins'))) + co_entry['OrganizationalStatus'] = [co.get('status', 'active')] co_dns = dst.rfind(f"dc=ordered,dc={service}", f"(&(objectClass=organization)(o={co_identifier}))") diff --git a/sbs.py b/sbs.py index 3b736be..1d89705 100644 --- a/sbs.py +++ b/sbs.py @@ -199,11 +199,7 @@ def service_collaborations(self): c['admins'] = [] for m in c.get('collaboration_memberships', []): - status = c.get('status', 'active') - if status == 'active': - status = m['status'] - - m['user'] = {**users[m['user_id']], **{'status': status}} + m['user'] = {**users[m['user_id']], **{'status': m.get('status', None)}} if m['role'] == 'admin': c['admins'].append(m['user'])