From 46549b93681ffee6edc1824f9ca5eaace4da9878 Mon Sep 17 00:00:00 2001 From: Mustafa Baser Date: Tue, 29 Nov 2022 12:23:54 +0300 Subject: [PATCH] fix: jans-linux-setup create scope if inum exists (ref: #3097) --- .../jans_setup/setup_app/installers/config_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jans-linux-setup/jans_setup/setup_app/installers/config_api.py b/jans-linux-setup/jans_setup/setup_app/installers/config_api.py index 2e5284c049c..ba1948a798e 100644 --- a/jans-linux-setup/jans_setup/setup_app/installers/config_api.py +++ b/jans-linux-setup/jans_setup/setup_app/installers/config_api.py @@ -124,13 +124,13 @@ def generate_configuration(self): for scope_level in scope_levels: for scope in (condition.get(scope_level, [])): + if not scope.get('inum'): + continue + if Config.installed_instance and self.dbUtils.search('ou=scopes,o=jans', search_filter='(&(jansId={})(objectClass=jansScope))'.format(scope['name'])): continue if not scope['name'] in scopes: - inum = scope['inum'] - if not inum: - inum = '1800.' + scope_levels[scope_level] + '.' + os.urandom(4).hex().upper() scope_dn = 'inum={},ou=scopes,o=jans'.format(inum) scopes[scope['name']] = {'dn': scope_dn} display_name = 'Config API scope {}'.format(scope['name'])