Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def parse_configuration(self, config, context):
self.config = ConfigParser.SafeConfigParser(self.config_defaults)
if isinstance(config, str):
self.config.readfp(open(config))
elif isinstance(config, dict):
for section, options in config.items():
self.config.add_section(section)
for k, v in options.items():
self.config.set(section, k, v)
self.context = context
self.context.md_core_model = mappings.MD_CORE_MODEL
self.context.refresh_dc(mappings.MD_CORE_MODEL)
def parse_configuration(self, config, context):
self.config = ConfigParser.SafeConfigParser(self.config_defaults)
if isinstance(config, str):
self.config.readfp(open(config))
elif isinstance(config, dict):
for section, options in config.items():
self.config.add_section(section)
for k, v in options.items():
self.config.set(section, k, v)
self.context = context
self.context.md_core_model = mappings.MD_CORE_MODEL
self.context.refresh_dc(mappings.MD_CORE_MODEL)