WBEMDataSource.py 文件源码

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

项目:docker-zenoss4 作者: krull 项目源码 文件源码
def collect(self, config):

        ds0 = config.datasources[0]

        credentials = (ds0.zWBEMUsername, ds0.zWBEMPassword)

        url = '{0}://{1}:{2}'.format(
            'https' if ds0.zWBEMUseSSL else 'http',
            ds0.manageIp, ds0.zWBEMPort
        )

        def _inner():
            return WBEMConnection(url, credentials).ExecQuery(
                ds0.params['query_language'],
                ds0.params['query'],
                namespace=ds0.params['namespace'])
        return threads.deferToThread(_inner)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号