Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def handleList(self, confInfo):
logger.info("start list setup configure.")
scheme, host, port = utils.extract_http_scheme_host_port(scc.getMgmtUri())
conf_mgr = conf.ConfManager(self.getSessionKey(), self.appName, scheme=scheme, host=host, port=port)
ta_conf_file = get_or_create_conf_file(conf_mgr, setup_const.myta_conf)
# read globala and proxy settings
all_settings = ta_conf_file.get_all()
if not all_settings:
all_settings = {}
self._setNoneValues(all_settings.get(setup_const.global_settings, {}))
# read account credential settings
for cred, cred_conf in self.cred_confs:
cred_conf_file = get_or_create_conf_file(conf_mgr, cred_conf)
creds = cred_conf_file.get_all()
if creds:
self._setNoneValues(creds)
all_settings.update({cred: creds})
# customized conf
customized_conf_file = get_or_create_conf_file(conf_mgr, setup_const.myta_customized_conf)
settings = customized_conf_file.get_all()
def handleList(self, confInfo):
logger.info("start list setup configure.")
scheme, host, port = utils.extract_http_scheme_host_port(scc.getMgmtUri())
conf_mgr = conf.ConfManager(self.getSessionKey(), self.appName, scheme=scheme, host=host, port=port)
ta_conf_file = get_or_create_conf_file(conf_mgr, setup_const.myta_conf)
# read globala and proxy settings
all_settings = ta_conf_file.get_all()
if not all_settings:
all_settings = {}
self._setNoneValues(all_settings.get(setup_const.global_settings, {}))
# read account credential settings
for cred, cred_conf in self.cred_confs:
cred_conf_file = get_or_create_conf_file(conf_mgr, cred_conf)
creds = cred_conf_file.get_all()
if creds:
self._setNoneValues(creds)
all_settings.update({cred: creds})
# customized conf
customized_conf_file = get_or_create_conf_file(conf_mgr, setup_const.myta_customized_conf)
settings = customized_conf_file.get_all()
def _migrate(self):
internal_endpoint = self.endpoint.internal_endpoint
if not (internal_endpoint.endswith('settings') or
internal_endpoint.endswith('account')):
return
splunkd_info = urlparse(get_splunkd_uri())
self.base_app_name = util.get_base_app_name()
self.conf_mgr = ConfManager(
self.getSessionKey(),
self.base_app_name,
scheme=splunkd_info.scheme,
host=splunkd_info.hostname,
port=splunkd_info.port,
)
self.client = SplunkRestClient(
self.getSessionKey(),
self.base_app_name,
scheme=splunkd_info.scheme,
host=splunkd_info.hostname,
port=splunkd_info.port,
)
self.legacy_passwords = None
# migration legacy configuration in related conf files