diff --git a/jans-linux-setup/jans_setup/setup_app/installers/jans.py b/jans-linux-setup/jans_setup/setup_app/installers/jans.py index a5cb83f60a9..3c500f8d57c 100644 --- a/jans-linux-setup/jans_setup/setup_app/installers/jans.py +++ b/jans-linux-setup/jans_setup/setup_app/installers/jans.py @@ -433,9 +433,12 @@ def import_custom_ldif_dir(self, ldif_dir): def create_test_client(self): ldif_fn = self.clients_ldif_fn = os.path.join(Config.output_dir, 'test-client.ldif') - client_pw = base.argsp.test_client_secret or self.getPW() + client_id = Config.get('test_client_id') or base.argsp.test_client_id + client_pw = Config.get('test_client_pw') or base.argsp.test_client_secret or self.getPW() encoded_pw = self.obscure(client_pw) - trusted_client = base.argsp.test_client_trusted or 'false' + trusted_client = Config.get('test_client_trusted_client') + if not trusted_client: + trusted_client = 'true' if base.argsp.test_client_trusted else 'false' if base.argsp.test_client_redirect_uri: redirect_uri = base.argsp.test_client_redirect_uri.split(',') @@ -447,7 +450,7 @@ def create_test_client(self): create_client_ldif( ldif_fn=ldif_fn, - client_id=base.argsp.test_client_id, + client_id=client_id, encoded_pw=encoded_pw, scopes=scopes, redirect_uri=redirect_uri, @@ -466,7 +469,7 @@ def create_test_client(self): def post_install_before_saving_properties(self): - if base.argsp.test_client_id: + if base.argsp.test_client_id or Config.test_client_id: self.create_test_client() diff --git a/jans-linux-setup/jans_setup/setup_app/utils/db_utils.py b/jans-linux-setup/jans_setup/setup_app/utils/db_utils.py index f11035aeb8f..97d8caeeb5e 100644 --- a/jans-linux-setup/jans_setup/setup_app/utils/db_utils.py +++ b/jans-linux-setup/jans_setup/setup_app/utils/db_utils.py @@ -440,12 +440,12 @@ def search(self, search_base, search_filter='(objectClass=*)', search_scope=ldap sql_cmd = 'SELECT * FROM {} WHERE ({}) {}'.format(s_table, dn_clause, where_clause) - retVal = self.spanner_client.get_dict_data(sql_cmd) + result = self.spanner_client.get_dict_data(sql_cmd) - if not fetchmany and retVal: - retVal = retVal[0] + if not fetchmany and result: + return result[0] - return retVal + return [ (ldif_utils.get_key_from(item['dn']), item) for item in retVal ] sqlalchemy_table = self.Base.classes[s_table] sqlalchemyQueryObject = self.session.query(sqlalchemy_table) @@ -469,7 +469,7 @@ def search(self, search_base, search_filter='(objectClass=*)', search_scope=ldap if fetchmany: result = sqlalchemyQueryObject.all() - return [ item.__dict__ for item in result ] + return [ (ldif_utils.get_key_from(item.dn), item.__dict__) for item in result ] else: result = sqlalchemyQueryObject.first() @@ -508,7 +508,7 @@ def search(self, search_base, search_filter='(objectClass=*)', search_scope=ldap data = result.json() if data.get('results'): if fetchmany: - return [ item[bucket] for item in data['results'] ] + return [ (ldif_utils.get_key_from(item[bucket]['dn']), item[bucket]) for item in data['results'] ] else: return data['results'][0][bucket] diff --git a/jans-linux-setup/jans_setup/setup_app/utils/properties_utils.py b/jans-linux-setup/jans_setup/setup_app/utils/properties_utils.py index 1284e175a84..9d5eb8e296b 100644 --- a/jans-linux-setup/jans_setup/setup_app/utils/properties_utils.py +++ b/jans-linux-setup/jans_setup/setup_app/utils/properties_utils.py @@ -208,6 +208,9 @@ def load_properties(self, prop_file, no_update=[]): if p.get('enable-script'): base.argsp.enable_script = p['enable-script'].split() + if p.get('rdbm_type') == 'pgsql' and not p.get('rdbm_port'): + p['rdbm_port'] = '5432' + properties_list = list(p.keys()) for prop in properties_list: @@ -241,7 +244,7 @@ def load_properties(self, prop_file, no_update=[]): elif p.get('installLdap','').lower() == 'true': Config.opendj_install = InstallTypes.LOCAL elif p.get('opendj_install'): - Config.opendj_install = p['opendj_install'] + Config.opendj_install = p['opendj_install'] else: Config.opendj_install = InstallTypes.NONE @@ -264,7 +267,6 @@ def load_properties(self, prop_file, no_update=[]): print("Couchbase package is not available exiting.") sys.exit(1) - if ('cb_password' not in properties_list) and Config.cb_install: Config.cb_password = p.get('ldapPass')