Skip to content

Commit 9d9ca4c

Browse files
committed
Merge branch 'feature/adobe-only-max-count' into v2
2 parents 6b6f654 + d761c5e commit 9d9ca4c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

examples/config files - basic/user-sync-config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ directory_users:
7979
# See https://adobe-apiplatform.github.io/user-sync.py/en/user-manual/configuring_user_sync_tool.html#limits-config
8080
limits:
8181
max_adobe_only_users: 200
82+
# group_removals_only: True
8283

8384
# --- Logging Options ---
8485
# Options that govern logging to the terminal (console) and/or log file(s)

user_sync/config/user_sync.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,9 @@ def get_engine_options(self):
531531
limits_config = self.main_config.get_dict_config('limits')
532532
max_missing = limits_config.get_value('max_adobe_only_users', (int, str), False)
533533
options['max_adobe_only_users'] = validate_max_limit_config(max_missing)
534+
group_removals_only = limits_config.get_value('group_removals_only', bool, True)
535+
if group_removals_only is not None:
536+
options['group_removals_only'] = group_removals_only
534537

535538
# now get the directory extension, if any
536539
extension_config = self.get_directory_extension_options()

user_sync/engine/umapi.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class RuleProcessor(object):
4949
'exclude_users': [],
5050
'extended_attributes': set(),
5151
'extension_enabled': False,
52+
'group_removals_only': False,
5253
'process_groups': False,
5354
'max_adobe_only_users': 200,
5455
'new_account_type': user_sync.identity_type.ENTERPRISE_IDENTITY_TYPE,
@@ -611,7 +612,10 @@ def is_selected_user_key(self, user_key):
611612
return True
612613

613614
def get_stray_keys(self, umapi_name=PRIMARY_TARGET_NAME):
614-
return self.stray_key_map.get(umapi_name, {})
615+
key_map = self.stray_key_map.get(umapi_name, {})
616+
if self.options['group_removals_only']:
617+
return {key: groups for key, groups in key_map.items() if groups}
618+
return key_map
615619

616620
def add_stray(self, umapi_name, user_key, removed_groups=None):
617621
"""

0 commit comments

Comments
 (0)