You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2016/05/19 19:41:03 UTC
incubator-impala git commit: IMPALA-3449: Kudu deploy.py should find
clusters by displayName
Repository: incubator-impala
Updated Branches:
refs/heads/master cb2a3aacd -> 3403037b9
IMPALA-3449: Kudu deploy.py should find clusters by displayName
"cluster.name" is actually something of an internal Cloudera Manager
identifier. "cluster.displayName" is the user visible name. The API
methed get_cluster() will search for both. I did some manual testing and
it seems to work.
Change-Id: Ia5b828e3f32c5483e76b055a5fcd0487a54ee9ea
Reviewed-on: http://gerrit.cloudera.org:8080/3106
Reviewed-by: Casey Ching <ca...@cloudera.com>
Tested-by: Casey Ching <ca...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/3403037b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/3403037b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/3403037b
Branch: refs/heads/master
Commit: 3403037b9707e49bbfec81eb64c3fa6771f9bfff
Parents: cb2a3aa
Author: Casey Ching <ca...@cloudera.com>
Authored: Tue May 17 13:49:21 2016 -0700
Committer: Tim Armstrong <ta...@cloudera.com>
Committed: Thu May 19 12:40:57 2016 -0700
----------------------------------------------------------------------
infra/deploy/deploy.py | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/3403037b/infra/deploy/deploy.py
----------------------------------------------------------------------
diff --git a/infra/deploy/deploy.py b/infra/deploy/deploy.py
index 1c6bdd0..289c44e 100644
--- a/infra/deploy/deploy.py
+++ b/infra/deploy/deploy.py
@@ -101,20 +101,17 @@ def parse_args():
return parser.parse_args()
def find_cluster(api, cluster_name):
- all_clusters = api.get_all_clusters()
- if not cluster_name and len(all_clusters) > 1:
- raise Exception("Cannot use implicit cluster; there is more than one available")
-
- for cluster in all_clusters:
- if (cluster_name and cluster.name == cluster_name) or not cluster_name:
- print "Found cluster: %s" % (cluster.name,)
- return cluster
-
if cluster_name:
- message = "Cannot find cluster: %s" % (cluster_name,)
+ cluster = api.get_cluster(cluster_name)
else:
- message = "Cannot find implicit cluster"
- raise Exception(message)
+ all_clusters = api.get_all_clusters()
+ if len(all_clusters) == 0:
+ raise Exception("No clusters found; create one before calling this script")
+ if len(all_clusters) > 1:
+ raise Exception("Cannot use implicit cluster; there is more than one available")
+ cluster = all_clusters[0]
+ print("Found cluster: %s" % (cluster.displayName, ))
+ return cluster
def find_dependencies(args, cluster):
deps = []