Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_config(provided_config_file):
provided_config = configparser.ConfigParser()
default_config_path = os.path.join(dir, 'config.ini')
try:
with open(default_config_path) as f_default:
provided_config.read_file(f_default)
with open(provided_config_file) as f_prov:
provided_config.read_file(f_prov)
if not provided_config.options('Microsoft Teams'):
raise MissingConnectorConfigKeyException('missing connector key in provided config')
except configparser.NoSectionError:
raise MissingConnectorConfigKeyException('missing required Microsoft Teams / '
'connector key in provided config')
return provided_config
def get_config(provided_config_file):
provided_config = configparser.ConfigParser()
default_config_path = os.path.join(dir, 'config.ini')
try:
with open(default_config_path) as f_default:
provided_config.read_file(f_default)
with open(provided_config_file) as f_prov:
provided_config.read_file(f_prov)
if not provided_config.options('Microsoft Teams'):
raise MissingConnectorConfigKeyException('missing connector key in provided config')
except configparser.NoSectionError:
raise MissingConnectorConfigKeyException('missing required Microsoft Teams / '
'connector key in provided config')
return provided_config