How to use the solnlib.conf_manager.ConfManagerException function in solnlib

To help you get started, we’ve selected a few solnlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PaloAltoNetworks / pandevice / install / Splunk_TA_paloalto / bin / splunk_ta_paloalto_setup_util.py View on Github external
ta_conf_file = get_or_create_conf_file(conf_mgr, setup_const.myta_conf)
        credential_conf_file = get_or_create_conf_file(
            conf_mgr, setup_const.myta_credential_conf)
        # read global 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:
            try:
                cred_conf_file = get_or_create_conf_file(conf_mgr, cred_conf)
                creds_data = cred_conf_file.get_all()
                self._setNoneValues(creds_data)
                all_settings.update({cred: creds_data})
            except conf.ConfManagerException as e:
                self.log_info('Conf {} not found.'.format(cred))
        # read customized settings
        customized_conf_file = get_or_create_conf_file(
            conf_mgr, setup_const.myta_customized_conf)
        settings = customized_conf_file.get_all()
        all_settings[setup_const.myta_customized_settings] = settings

        self._setNoneValues(all_settings.get(
            setup_const.myta_customized_settings, {}))
        return filter_eai_property(all_settings)
github PaloAltoNetworks / Splunk_TA_paloalto / bin / splunk_ta_paloalto_setup_util.py View on Github external
ta_conf_file = get_or_create_conf_file(conf_mgr, setup_const.myta_conf)
        credential_conf_file = get_or_create_conf_file(
            conf_mgr, setup_const.myta_credential_conf)
        # read global 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:
            try:
                cred_conf_file = get_or_create_conf_file(conf_mgr, cred_conf)
                creds_data = cred_conf_file.get_all()
                self._setNoneValues(creds_data)
                all_settings.update({cred: creds_data})
            except conf.ConfManagerException as e:
                self.log_info('Conf {} not found.'.format(cred))
        # read customized settings
        customized_conf_file = get_or_create_conf_file(
            conf_mgr, setup_const.myta_customized_conf)
        settings = customized_conf_file.get_all()
        all_settings[setup_const.myta_customized_settings] = settings

        self._setNoneValues(all_settings.get(
            setup_const.myta_customized_settings, {}))
        return filter_eai_property(all_settings)
github PaloAltoNetworks / Splunk_TA_paloalto / bin / splunk_ta_paloalto_setup.py View on Github external
def get_or_create_conf_file(conf_mgr, file_name):
    try:
        conf_file = conf_mgr.get_conf(file_name)
        return conf_file
    except conf.ConfManagerException as cme:
        conf_mgr._confs.create(file_name)
        return conf_mgr.get_conf(file_name, refresh=True)
github PaloAltoNetworks / pandevice / install / Splunk_TA_paloalto / bin / splunk_ta_paloalto_setup.py View on Github external
def get_or_create_conf_file(conf_mgr, file_name):
    try:
        conf_file = conf_mgr.get_conf(file_name)
        return conf_file
    except conf.ConfManagerException as cme:
        conf_mgr._confs.create(file_name)
        return conf_mgr.get_conf(file_name, refresh=True)