You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by mx...@apache.org on 2017/05/23 15:57:44 UTC

incubator-ariatosca git commit: minor fixes

Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-185-NullPool-logging-messages-appear-during-execution 8ce1dddd1 -> 75ab5edac


minor fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/75ab5eda
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/75ab5eda
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/75ab5eda

Branch: refs/heads/ARIA-185-NullPool-logging-messages-appear-during-execution
Commit: 75ab5edac1dc833e0cbe092af8e4b11c4bdcace4
Parents: 8ce1ddd
Author: max-orlov <ma...@gigaspaces.com>
Authored: Tue May 23 18:49:19 2017 +0300
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Tue May 23 18:57:30 2017 +0300

----------------------------------------------------------------------
 aria/orchestrator/execution_plugin/ctx_proxy/client.py  | 12 ++++++------
 .../execution_plugin/test_ctx_proxy_server.py           |  1 +
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/75ab5eda/aria/orchestrator/execution_plugin/ctx_proxy/client.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/execution_plugin/ctx_proxy/client.py b/aria/orchestrator/execution_plugin/ctx_proxy/client.py
index f58c727..fbfff57 100644
--- a/aria/orchestrator/execution_plugin/ctx_proxy/client.py
+++ b/aria/orchestrator/execution_plugin/ctx_proxy/client.py
@@ -45,7 +45,7 @@ def _http_request(socket_url, request, method, timeout):
     return json.loads(response.read())
 
 
-def _client_request(socket_url, args, method, timeout):
+def _client_request(socket_url, args, timeout, method='POST'):
     response = _http_request(
         socket_url=socket_url,
         request={'args': args},
@@ -90,15 +90,15 @@ def _process_args(json_prefix, args):
 
 
 def _close_session(socket_url, timeout):
-    return _client_request(socket_url, [], 'DELETE', timeout)
+    return _client_request(socket_url, [], timeout, 'DELETE')
 
 
 def main(args=None):
     try:
         args = _parse_args(args)
-        response = _client_request(args.socket_url,
+        response = _client_request(
+            args.socket_url,
             args=_process_args(args.json_arg_prefix, args.args),
-            method='POST',
             timeout=args.timeout)
         if args.json_output:
             response = json.dumps(response)
@@ -107,11 +107,11 @@ def main(args=None):
                 response = ''
             response = str(response)
         sys.stdout.write(response)
-    except BaseException:
+    except BaseException as origial_e:
         try:
             _close_session(args.socket_url, args.timeout)
         except BaseException:
-            pass
+            raise origial_e
 
 if __name__ == '__main__':
     main()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/75ab5eda/tests/orchestrator/execution_plugin/test_ctx_proxy_server.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/execution_plugin/test_ctx_proxy_server.py b/tests/orchestrator/execution_plugin/test_ctx_proxy_server.py
index 98ceff9..c94bae7 100644
--- a/tests/orchestrator/execution_plugin/test_ctx_proxy_server.py
+++ b/tests/orchestrator/execution_plugin/test_ctx_proxy_server.py
@@ -165,6 +165,7 @@ class TestCtxProxy(object):
     @pytest.fixture
     def server(self, ctx):
         result = ctx_proxy.server.CtxProxy(ctx)
+        result._close_session = lambda *args, **kwargs: {}
         yield result
         result.close()