config.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:deb-python-kmip 作者: openstack 项目源码 文件源码
def load_settings(self, path):
        """
        Load configuration settings from the file pointed to by path.

        This will overwrite all current setting values.

        Args:
            path (string): The path to the configuration file containing
                the settings to load. Required.
        Raises:
            ConfigurationError: Raised if the path does not point to an
                existing file or if a setting value is invalid.
        """
        if not os.path.exists(path):
            raise exceptions.ConfigurationError(
                "The server configuration file ('{0}') could not be "
                "located.".format(path)
            )

        self._logger.info(
            "Loading server configuration settings from: {0}".format(path)
        )

        parser = configparser.SafeConfigParser()
        parser.read(path)
        self._parse_settings(parser)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号