show reason of proxmoxer exceptions

This commit is contained in:
Sergey Bubnov 2018-10-29 15:24:46 +04:00
parent bbf8824b00
commit 931f23159b
2 changed files with 12 additions and 0 deletions

View File

@ -11,6 +11,7 @@ python27.pkgs.buildPythonPackage rec {
sha256 = "145hvphvlzvwq6sn31ldnin0ii50blsapxz0gv2zx3grzp6x9hvh"; sha256 = "145hvphvlzvwq6sn31ldnin0ii50blsapxz0gv2zx3grzp6x9hvh";
}; };
patches = [ ./show_reason_on_exceptions.patch ];
doCheck = false; doCheck = false;
meta = { meta = {

View File

@ -0,0 +1,11 @@
--- a/proxmoxer/core.py 1970-01-01 04:00:01.000000000 +0400
+++ b/proxmoxer/core.py 2018-10-29 15:21:20.241881023 +0400
@@ -76,7 +76,7 @@
if resp.status_code >= 400:
raise ResourceException("{0} {1}: {2}".format(resp.status_code, httplib.responses[resp.status_code],
- resp.content))
+ resp.reason))
elif 200 <= resp.status_code <= 299:
return self._store["serializer"].loads(resp)