2017-09-06 134 views
0

我正在尋找解決方案,該解決方案使我能夠找到身份驗證提供程序名稱並將其置於變量中。我想這樣的事情:WebLogic WLST find AuthenticationProviderName

LDAPProviderName = getAuthenticationProviderName(ProviderClassName='weblogic.security.providers.authentication.LDAPAuthenticationProviderImpl') 
cd('/base_domain/serverConfig/SecurityConfiguration/base_domain/Realms/myrealm/AuthenticationProviders/' + LDAPProviderName) 

回答

0

我已經找到了解決辦法髒爲:

import re 
AuthProviders = find('ProviderClassName') 
LDAPProviderRegex = re.compile(r'LDAPAuthenticationProviderImpl') 
LDAPProvider = filter(LDAPProviderRegex.search, AuthProviders) 
LDAPProviderStr = str(LDAPProvider) 
LDAPProviderSub = re.sub(r"\sProviderClassName.*$", "", LDAPProviderStr) 
LDAPProviderName = re.sub(r"^[[]['][/].*[/](.*)$", "\\1", LDAPProviderSub)