libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [1/6] libcloud git commit: prettier error on fieldname
Date Tue, 11 Oct 2016 22:42:09 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 489793358 -> 065d1919d


prettier error on fieldname


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/23b02881
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/23b02881
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/23b02881

Branch: refs/heads/trunk
Commit: 23b0288143aaa774d90828b488cb86ef846e8743
Parents: 6dce592
Author: Mario Loria <mario@arroyonetworks.com>
Authored: Mon Oct 10 17:04:33 2016 -0400
Committer: Mario Loria <mario@arroyonetworks.com>
Committed: Mon Oct 10 17:04:33 2016 -0400

----------------------------------------------------------------------
 libcloud/container/drivers/rancher.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/23b02881/libcloud/container/drivers/rancher.py
----------------------------------------------------------------------
diff --git a/libcloud/container/drivers/rancher.py b/libcloud/container/drivers/rancher.py
index c0d2f9d..dbf28f2 100644
--- a/libcloud/container/drivers/rancher.py
+++ b/libcloud/container/drivers/rancher.py
@@ -39,7 +39,12 @@ class RancherResponse(JsonResponse):
 
     def parse_error(self):
         parsed = super(RancherResponse, self).parse_error()
-        return "%s - %s" % (parsed['message'], parsed['detail'])
+        if 'fieldName' in parsed:
+            return "Field %s is %s: %s - %s" % (parsed['fieldName'], parsed['code'],
+                                          parsed['message'], parsed['detail'])
+        else:
+            return "%%s - %s" % (parsed['message'],
+                                    parsed['detail'])
 
     def success(self):
         return self.status in VALID_RESPONSE_CODES


Mime
View raw message