client: pass http responce when an error occurs

Thus the caller can examine error code instead of abort blindly
and can provide more informative message.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Isaku Yamahata
2012-02-02 14:48:37 +09:00
committed by FUJITA Tomonori
parent c22ef47a9c
commit 89a3f010b8

View File

@@ -41,8 +41,9 @@ class OFPClientV1_0(object):
httplib.NO_CONTENT):
return res
raise httplib.HTTPException('code %d reason %s' %
(res.status, res.reason))
raise httplib.HTTPException(
res, 'code %d reason %s' % (res.status, res.reason),
res.getheaders(), res.read())
def get_networks(self):
res = self._do_request('GET', '')