def __init__(self, config_file=None):
        self.config_file = config_file
        self._config = {}

        if config_file:
            try:
                f = open(config_file, 'r')
            except IOError:
                raise utils.ConfigError("Could not read config file.",
                                        config_file)

            try:
                self._config = yaml.safe_load(f)
                self.validate(config_file)
            except yaml.YAMLError:
                raise utils.ConfigError("Error parsing file.", config_file)

            # valid config must be a dict
            if not isinstance(self._config, dict):
                raise utils.ConfigError("Error parsing file.", config_file)

            self.convert_legacy_config()

        else:
            # use sane defaults
            self._config['plugin_name_pattern'] = '*.py'
            self._config['include'] = ['*.py', '*.pyw']

        self._init_settings()
Add MAC and IP addresses to interface XML elements.
dataset/ETHPy150Open openstack/bandit/bandit/core/config.py/BanditConfig.__init__--crossover with--dataset/ETHPy150Open coreemu/core/daemon/core/misc/xmlwriter0.py/CoreDocumentWriter0.addaddresses