IxChassisUtils.py 文件源码

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

项目:functest 作者: opnfv 项目源码 文件源码
def patch(url, payload, apiKey):
        urlHeadersJson = {'content-type': 'application/json',
                          'X-Api-Key': '%s' % str(apiKey)}
        try:
            h = httplib2.Http('.cache',
                              disable_ssl_certificate_validation=True)
            logger.debug('PATCH: ' + url + ' <-- Attribute: ' +
                         str(payload))
            (response, content) = h.request(url, 'PATCH',
                                            json.dumps(payload),
                                            urlHeadersJson)
        except Exception, e:

            # print (response, content)

            raise Exception('Got an error code: ', e)
        return content
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号