You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by kl...@apache.org on 2018/10/15 11:40:30 UTC

[mesos] branch master updated (00e2b6c -> 3b8be5a)

This is an automated email from the ASF dual-hosted git repository.

klueska pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git.


    from 00e2b6c  Moved MESOS-9279 to 1.4.2 CHANGELOG.
     new c2ceb8d  Removed variable printing in error strings in new CLI.
     new 3b8be5a  Added try/catch statements when using Mesos util functions in new CLI.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/python/cli_new/lib/cli/mesos.py              | 8 ++++----
 src/python/cli_new/lib/cli/plugins/agent/main.py | 8 +++++++-
 src/python/cli_new/lib/cli/plugins/task/main.py  | 8 +++++++-
 3 files changed, 18 insertions(+), 6 deletions(-)


[mesos] 01/02: Removed variable printing in error strings in new CLI.

Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

klueska pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit c2ceb8d83447ad00a62e77d978d63d69b4da6567
Author: Armand Grillet <ag...@mesosphere.io>
AuthorDate: Mon Oct 15 07:37:36 2018 -0400

    Removed variable printing in error strings in new CLI.
    
    By convention, the caller should print variables passed in as arguments
    to other functions. In these cases the callee was printing them,
    resulting in the variables being printed twice, redundantly.
    
    Review: https://reviews.apache.org/r/68965/
---
 src/python/cli_new/lib/cli/mesos.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/python/cli_new/lib/cli/mesos.py b/src/python/cli_new/lib/cli/mesos.py
index 7cf84bc..26556c5 100644
--- a/src/python/cli_new/lib/cli/mesos.py
+++ b/src/python/cli_new/lib/cli/mesos.py
@@ -51,8 +51,8 @@ def get_agents(master):
         data = http.get_json(master, endpoint)
     except Exception as exception:
         raise CLIException(
-            "Could not open '/{endpoint}' on master address '{addr}': {error}"
-            .format(endpoint=endpoint, addr=master, error=exception))
+            "Could not open '/{endpoint}' on master: {error}"
+            .format(endpoint=endpoint, error=exception))
 
     if not key in data:
         raise CLIException(
@@ -74,8 +74,8 @@ def get_tasks(master):
         data = http.get_json(master, endpoint)
     except Exception as exception:
         raise CLIException(
-            "Could not open '/{endpoint}' on master address '{addr}': {error}"
-            .format(endpoint=endpoint, addr=master, error=exception))
+            "Could not open '/{endpoint}' on master: {error}"
+            .format(endpoint=endpoint, error=exception))
 
     if not key in data:
         raise CLIException(


[mesos] 02/02: Added try/catch statements when using Mesos util functions in new CLI.

Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

klueska pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 3b8be5a17ad9ce9e981ddc2c0789c37af1700de0
Author: Armand Grillet <ag...@mesosphere.io>
AuthorDate: Mon Oct 15 07:36:27 2018 -0400

    Added try/catch statements when using Mesos util functions in new CLI.
    
    Review: https://reviews.apache.org/r/68965/
---
 src/python/cli_new/lib/cli/plugins/agent/main.py | 8 +++++++-
 src/python/cli_new/lib/cli/plugins/task/main.py  | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/python/cli_new/lib/cli/plugins/agent/main.py b/src/python/cli_new/lib/cli/plugins/agent/main.py
index 5e821b3..4a658f9 100644
--- a/src/python/cli_new/lib/cli/plugins/agent/main.py
+++ b/src/python/cli_new/lib/cli/plugins/agent/main.py
@@ -57,7 +57,13 @@ class Agent(PluginBase):
             raise CLIException("Unable to get leading master address: {error}"
                                .format(error=exception))
 
-        agents = get_agents(master)
+        try:
+            agents = get_agents(master)
+        except Exception as exception:
+            raise CLIException("Unable to get agents from leading"
+                               " master '{master}': {error}"
+                               .format(master=master, error=exception))
+
         if not agents:
             print("The cluster does not have any agents.")
             return
diff --git a/src/python/cli_new/lib/cli/plugins/task/main.py b/src/python/cli_new/lib/cli/plugins/task/main.py
index a47a8c5..8a4a859 100644
--- a/src/python/cli_new/lib/cli/plugins/task/main.py
+++ b/src/python/cli_new/lib/cli/plugins/task/main.py
@@ -56,7 +56,13 @@ class Task(PluginBase):
             raise CLIException("Unable to get leading master address: {error}"
                                .format(error=exception))
 
-        tasks = get_tasks(master)
+        try:
+            tasks = get_tasks(master)
+        except Exception as exception:
+            raise CLIException("Unable to get tasks from leading"
+                               " master '{master}': {error}"
+                               .format(master=master, error=exception))
+
         if not tasks:
             print("There are no tasks running in the cluster.")
             return