aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject git commit: Fixing transient error message formatting in scheduler_client.py
Date Tue, 28 Oct 2014 20:54:57 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master a675213fc -> 88bc2f241


Fixing transient error message formatting in scheduler_client.py

Bugs closed: AURORA-900

Reviewed at https://reviews.apache.org/r/27266/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/88bc2f24
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/88bc2f24
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/88bc2f24

Branch: refs/heads/master
Commit: 88bc2f2411961031d33e7b9c24a729cc2b206e0e
Parents: a675213
Author: Maxim Khutornenko <maxim@apache.org>
Authored: Tue Oct 28 13:54:27 2014 -0700
Committer: Maxim Khutornenko <maxim@apache.org>
Committed: Tue Oct 28 13:54:27 2014 -0700

----------------------------------------------------------------------
 src/main/python/apache/aurora/client/api/scheduler_client.py      | 2 +-
 src/test/python/apache/aurora/client/api/test_scheduler_client.py | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/88bc2f24/src/main/python/apache/aurora/client/api/scheduler_client.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/api/scheduler_client.py b/src/main/python/apache/aurora/client/api/scheduler_client.py
index 696dc3b..3a851cc 100644
--- a/src/main/python/apache/aurora/client/api/scheduler_client.py
+++ b/src/main/python/apache/aurora/client/api/scheduler_client.py
@@ -287,7 +287,7 @@ class SchedulerProxy(object):
             resp = method(*(args + auth_args))
             if resp is not None and resp.responseCode == ResponseCode.ERROR_TRANSIENT:
               raise self.TransientError(", ".join(
-                  [m for m in resp.details] if resp.details else []))
+                  [m.message for m in resp.details] if resp.details else []))
             if resp.serverInfo.thriftAPIVersion != THRIFT_API_VERSION:
               raise self.APIVersionError("Client Version: %s, Server Version: %s" %
                   (THRIFT_API_VERSION, resp.serverInfo.thriftAPIVersion))

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/88bc2f24/src/test/python/apache/aurora/client/api/test_scheduler_client.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_scheduler_client.py b/src/test/python/apache/aurora/client/api/test_scheduler_client.py
index 4d3c922..af8353e 100644
--- a/src/test/python/apache/aurora/client/api/test_scheduler_client.py
+++ b/src/test/python/apache/aurora/client/api/test_scheduler_client.py
@@ -42,6 +42,7 @@ from gen.apache.aurora.api.ttypes import (
     ResourceAggregate,
     Response,
     ResponseCode,
+    ResponseDetail,
     RewriteConfigsRequest,
     ScheduleStatus,
     ServerInfo,
@@ -398,7 +399,7 @@ def test_transient_error(_, client):
   mock_thrift_client = mock.Mock(spec=AuroraAdmin.Client)
   mock_thrift_client.killTasks.side_effect = [
       Response(responseCode=ResponseCode.ERROR_TRANSIENT,
-               details=["message1", "message2"],
+               details=[ResponseDetail(message="message1"), ResponseDetail(message="message2")],
                serverInfo=DEFAULT_RESPONSE.serverInfo),
       Response(responseCode=ResponseCode.ERROR_TRANSIENT,
                serverInfo=DEFAULT_RESPONSE.serverInfo),


Mime
View raw message