[25/50] [abbrv] ambari git commit: AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam)
AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0317cf71 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0317cf71 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0317cf71 Branch: refs/heads/branch-3.0-perf Commit: 0317cf7163165f4a6f90b2337bf97382679dfee4 Parents: 2a8ac0d Author: Venkata SairamAuthored: Mon Oct 16 18:20:06 2017 +0530 Committer: Venkata Sairam Committed: Mon Oct 16 18:20:06 2017 +0530 -- .../ZEPPELIN/0.7.0/package/scripts/master.py| 40 +--- .../stacks/2.6/ZEPPELIN/test_zeppelin_070.py| 3 ++ 2 files changed, 37 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0317cf71/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py -- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py index 9d179b8..6ccdfba 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py @@ -192,7 +192,7 @@ class Master(Script): notebook_directory = "/user/" + format("{zeppelin_user}") + "/" + \ params.config['configurations']['zeppelin-config']['zeppelin.notebook.dir'] -if not self.is_path_exists_in_HDFS(notebook_directory, params.zeppelin_user): +if not self.is_directory_exists_in_HDFS(notebook_directory, params.zeppelin_user): # hdfs dfs -mkdir {notebook_directory} params.HdfsResource(format("{notebook_directory}"), type="directory", @@ -243,7 +243,7 @@ class Master(Script): self.create_zeppelin_dir(params) if params.conf_stored_in_hdfs: - if not self.is_path_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): + if not self.is_directory_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): # hdfs dfs -mkdir {zeppelin's conf directory} params.HdfsResource(self.get_zeppelin_conf_FS_directory(params), type="directory", @@ -314,15 +314,17 @@ class Master(Script): def get_zeppelin_conf_FS(self, params): return self.get_zeppelin_conf_FS_directory(params) + "/interpreter.json" - def is_path_exists_in_HDFS(self, path, as_user): + def is_directory_exists_in_HDFS(self, path, as_user): kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") -path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -e {path};echo $?"), + +#-d: if the path is a directory, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -d {path};echo $?"), user=as_user)[1] # if there is no kerberos setup then the string will contain "-bash: kinit: command not found" if "\n" in path_exists: - path_exists = path_exists.split("\n")[1] + path_exists = path_exists.split("\n").pop() # '1' means it does not exists if path_exists == '0': @@ -330,6 +332,31 @@ class Master(Script): else: return False + def is_file_exists_in_HDFS(self, path, as_user): +kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) +kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") + +#-f: if the path is a file, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -f {path};echo $?"), + user=as_user)[1] + +# if there is no kerberos setup then the string will contain "-bash: kinit: command not found" +if "\n" in path_exists: + path_exists = path_exists.split("\n").pop() + +# '1' means it does not exists +if path_exists == '0': + #-z: if the file is zero length, return 0. + path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -z {path};echo $?"), + user=as_user)[1] + + if "\n" in path_exists: +path_exists =
[12/50] ambari git commit: AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam)
AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0317cf71 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0317cf71 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0317cf71 Branch: refs/heads/feature-branch-AMBARI-21307 Commit: 0317cf7163165f4a6f90b2337bf97382679dfee4 Parents: 2a8ac0d Author: Venkata SairamAuthored: Mon Oct 16 18:20:06 2017 +0530 Committer: Venkata Sairam Committed: Mon Oct 16 18:20:06 2017 +0530 -- .../ZEPPELIN/0.7.0/package/scripts/master.py| 40 +--- .../stacks/2.6/ZEPPELIN/test_zeppelin_070.py| 3 ++ 2 files changed, 37 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0317cf71/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py -- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py index 9d179b8..6ccdfba 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py @@ -192,7 +192,7 @@ class Master(Script): notebook_directory = "/user/" + format("{zeppelin_user}") + "/" + \ params.config['configurations']['zeppelin-config']['zeppelin.notebook.dir'] -if not self.is_path_exists_in_HDFS(notebook_directory, params.zeppelin_user): +if not self.is_directory_exists_in_HDFS(notebook_directory, params.zeppelin_user): # hdfs dfs -mkdir {notebook_directory} params.HdfsResource(format("{notebook_directory}"), type="directory", @@ -243,7 +243,7 @@ class Master(Script): self.create_zeppelin_dir(params) if params.conf_stored_in_hdfs: - if not self.is_path_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): + if not self.is_directory_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): # hdfs dfs -mkdir {zeppelin's conf directory} params.HdfsResource(self.get_zeppelin_conf_FS_directory(params), type="directory", @@ -314,15 +314,17 @@ class Master(Script): def get_zeppelin_conf_FS(self, params): return self.get_zeppelin_conf_FS_directory(params) + "/interpreter.json" - def is_path_exists_in_HDFS(self, path, as_user): + def is_directory_exists_in_HDFS(self, path, as_user): kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") -path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -e {path};echo $?"), + +#-d: if the path is a directory, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -d {path};echo $?"), user=as_user)[1] # if there is no kerberos setup then the string will contain "-bash: kinit: command not found" if "\n" in path_exists: - path_exists = path_exists.split("\n")[1] + path_exists = path_exists.split("\n").pop() # '1' means it does not exists if path_exists == '0': @@ -330,6 +332,31 @@ class Master(Script): else: return False + def is_file_exists_in_HDFS(self, path, as_user): +kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) +kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") + +#-f: if the path is a file, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -f {path};echo $?"), + user=as_user)[1] + +# if there is no kerberos setup then the string will contain "-bash: kinit: command not found" +if "\n" in path_exists: + path_exists = path_exists.split("\n").pop() + +# '1' means it does not exists +if path_exists == '0': + #-z: if the file is zero length, return 0. + path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -z {path};echo $?"), + user=as_user)[1] + + if "\n" in path_exists: +path_exists =
[38/50] ambari git commit: AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam)
AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0317cf71 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0317cf71 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0317cf71 Branch: refs/heads/branch-feature-AMBARI-22008 Commit: 0317cf7163165f4a6f90b2337bf97382679dfee4 Parents: 2a8ac0d Author: Venkata SairamAuthored: Mon Oct 16 18:20:06 2017 +0530 Committer: Venkata Sairam Committed: Mon Oct 16 18:20:06 2017 +0530 -- .../ZEPPELIN/0.7.0/package/scripts/master.py| 40 +--- .../stacks/2.6/ZEPPELIN/test_zeppelin_070.py| 3 ++ 2 files changed, 37 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0317cf71/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py -- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py index 9d179b8..6ccdfba 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py @@ -192,7 +192,7 @@ class Master(Script): notebook_directory = "/user/" + format("{zeppelin_user}") + "/" + \ params.config['configurations']['zeppelin-config']['zeppelin.notebook.dir'] -if not self.is_path_exists_in_HDFS(notebook_directory, params.zeppelin_user): +if not self.is_directory_exists_in_HDFS(notebook_directory, params.zeppelin_user): # hdfs dfs -mkdir {notebook_directory} params.HdfsResource(format("{notebook_directory}"), type="directory", @@ -243,7 +243,7 @@ class Master(Script): self.create_zeppelin_dir(params) if params.conf_stored_in_hdfs: - if not self.is_path_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): + if not self.is_directory_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): # hdfs dfs -mkdir {zeppelin's conf directory} params.HdfsResource(self.get_zeppelin_conf_FS_directory(params), type="directory", @@ -314,15 +314,17 @@ class Master(Script): def get_zeppelin_conf_FS(self, params): return self.get_zeppelin_conf_FS_directory(params) + "/interpreter.json" - def is_path_exists_in_HDFS(self, path, as_user): + def is_directory_exists_in_HDFS(self, path, as_user): kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") -path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -e {path};echo $?"), + +#-d: if the path is a directory, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -d {path};echo $?"), user=as_user)[1] # if there is no kerberos setup then the string will contain "-bash: kinit: command not found" if "\n" in path_exists: - path_exists = path_exists.split("\n")[1] + path_exists = path_exists.split("\n").pop() # '1' means it does not exists if path_exists == '0': @@ -330,6 +332,31 @@ class Master(Script): else: return False + def is_file_exists_in_HDFS(self, path, as_user): +kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) +kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") + +#-f: if the path is a file, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -f {path};echo $?"), + user=as_user)[1] + +# if there is no kerberos setup then the string will contain "-bash: kinit: command not found" +if "\n" in path_exists: + path_exists = path_exists.split("\n").pop() + +# '1' means it does not exists +if path_exists == '0': + #-z: if the file is zero length, return 0. + path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -z {path};echo $?"), + user=as_user)[1] + + if "\n" in path_exists: +path_exists =
[12/15] ambari git commit: AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam)
AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0317cf71 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0317cf71 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0317cf71 Branch: refs/heads/branch-feature-AMBARI-20859 Commit: 0317cf7163165f4a6f90b2337bf97382679dfee4 Parents: 2a8ac0d Author: Venkata SairamAuthored: Mon Oct 16 18:20:06 2017 +0530 Committer: Venkata Sairam Committed: Mon Oct 16 18:20:06 2017 +0530 -- .../ZEPPELIN/0.7.0/package/scripts/master.py| 40 +--- .../stacks/2.6/ZEPPELIN/test_zeppelin_070.py| 3 ++ 2 files changed, 37 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0317cf71/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py -- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py index 9d179b8..6ccdfba 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py @@ -192,7 +192,7 @@ class Master(Script): notebook_directory = "/user/" + format("{zeppelin_user}") + "/" + \ params.config['configurations']['zeppelin-config']['zeppelin.notebook.dir'] -if not self.is_path_exists_in_HDFS(notebook_directory, params.zeppelin_user): +if not self.is_directory_exists_in_HDFS(notebook_directory, params.zeppelin_user): # hdfs dfs -mkdir {notebook_directory} params.HdfsResource(format("{notebook_directory}"), type="directory", @@ -243,7 +243,7 @@ class Master(Script): self.create_zeppelin_dir(params) if params.conf_stored_in_hdfs: - if not self.is_path_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): + if not self.is_directory_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): # hdfs dfs -mkdir {zeppelin's conf directory} params.HdfsResource(self.get_zeppelin_conf_FS_directory(params), type="directory", @@ -314,15 +314,17 @@ class Master(Script): def get_zeppelin_conf_FS(self, params): return self.get_zeppelin_conf_FS_directory(params) + "/interpreter.json" - def is_path_exists_in_HDFS(self, path, as_user): + def is_directory_exists_in_HDFS(self, path, as_user): kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") -path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -e {path};echo $?"), + +#-d: if the path is a directory, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -d {path};echo $?"), user=as_user)[1] # if there is no kerberos setup then the string will contain "-bash: kinit: command not found" if "\n" in path_exists: - path_exists = path_exists.split("\n")[1] + path_exists = path_exists.split("\n").pop() # '1' means it does not exists if path_exists == '0': @@ -330,6 +332,31 @@ class Master(Script): else: return False + def is_file_exists_in_HDFS(self, path, as_user): +kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) +kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") + +#-f: if the path is a file, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -f {path};echo $?"), + user=as_user)[1] + +# if there is no kerberos setup then the string will contain "-bash: kinit: command not found" +if "\n" in path_exists: + path_exists = path_exists.split("\n").pop() + +# '1' means it does not exists +if path_exists == '0': + #-z: if the file is zero length, return 0. + path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -z {path};echo $?"), + user=as_user)[1] + + if "\n" in path_exists: +path_exists =
ambari git commit: AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/trunk 2a8ac0ded -> 0317cf716 AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0317cf71 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0317cf71 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0317cf71 Branch: refs/heads/trunk Commit: 0317cf7163165f4a6f90b2337bf97382679dfee4 Parents: 2a8ac0d Author: Venkata SairamAuthored: Mon Oct 16 18:20:06 2017 +0530 Committer: Venkata Sairam Committed: Mon Oct 16 18:20:06 2017 +0530 -- .../ZEPPELIN/0.7.0/package/scripts/master.py| 40 +--- .../stacks/2.6/ZEPPELIN/test_zeppelin_070.py| 3 ++ 2 files changed, 37 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/0317cf71/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py -- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py index 9d179b8..6ccdfba 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py @@ -192,7 +192,7 @@ class Master(Script): notebook_directory = "/user/" + format("{zeppelin_user}") + "/" + \ params.config['configurations']['zeppelin-config']['zeppelin.notebook.dir'] -if not self.is_path_exists_in_HDFS(notebook_directory, params.zeppelin_user): +if not self.is_directory_exists_in_HDFS(notebook_directory, params.zeppelin_user): # hdfs dfs -mkdir {notebook_directory} params.HdfsResource(format("{notebook_directory}"), type="directory", @@ -243,7 +243,7 @@ class Master(Script): self.create_zeppelin_dir(params) if params.conf_stored_in_hdfs: - if not self.is_path_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): + if not self.is_directory_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): # hdfs dfs -mkdir {zeppelin's conf directory} params.HdfsResource(self.get_zeppelin_conf_FS_directory(params), type="directory", @@ -314,15 +314,17 @@ class Master(Script): def get_zeppelin_conf_FS(self, params): return self.get_zeppelin_conf_FS_directory(params) + "/interpreter.json" - def is_path_exists_in_HDFS(self, path, as_user): + def is_directory_exists_in_HDFS(self, path, as_user): kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") -path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -e {path};echo $?"), + +#-d: if the path is a directory, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -d {path};echo $?"), user=as_user)[1] # if there is no kerberos setup then the string will contain "-bash: kinit: command not found" if "\n" in path_exists: - path_exists = path_exists.split("\n")[1] + path_exists = path_exists.split("\n").pop() # '1' means it does not exists if path_exists == '0': @@ -330,6 +332,31 @@ class Master(Script): else: return False + def is_file_exists_in_HDFS(self, path, as_user): +kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) +kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") + +#-f: if the path is a file, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -f {path};echo $?"), + user=as_user)[1] + +# if there is no kerberos setup then the string will contain "-bash: kinit: command not found" +if "\n" in path_exists: + path_exists = path_exists.split("\n").pop() + +# '1' means it does not exists +if path_exists == '0': + #-z: if the file is zero length, return 0. + path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -z {path};echo $?"), + user=as_user)[1]
ambari git commit: AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam)
Repository: ambari Updated Branches: refs/heads/branch-2.6 15d156b0d -> e99bfd023 AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e99bfd02 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e99bfd02 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e99bfd02 Branch: refs/heads/branch-2.6 Commit: e99bfd023621e352d6bb2328d14a61d4883c926d Parents: 15d156b Author: Venkata SairamAuthored: Mon Oct 16 18:18:45 2017 +0530 Committer: Venkata Sairam Committed: Mon Oct 16 18:18:45 2017 +0530 -- .../ZEPPELIN/0.7.0/package/scripts/master.py| 40 +--- 1 file changed, 34 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e99bfd02/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py -- diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py index 9d179b8..6ccdfba 100644 --- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py +++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py @@ -192,7 +192,7 @@ class Master(Script): notebook_directory = "/user/" + format("{zeppelin_user}") + "/" + \ params.config['configurations']['zeppelin-config']['zeppelin.notebook.dir'] -if not self.is_path_exists_in_HDFS(notebook_directory, params.zeppelin_user): +if not self.is_directory_exists_in_HDFS(notebook_directory, params.zeppelin_user): # hdfs dfs -mkdir {notebook_directory} params.HdfsResource(format("{notebook_directory}"), type="directory", @@ -243,7 +243,7 @@ class Master(Script): self.create_zeppelin_dir(params) if params.conf_stored_in_hdfs: - if not self.is_path_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): + if not self.is_directory_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user): # hdfs dfs -mkdir {zeppelin's conf directory} params.HdfsResource(self.get_zeppelin_conf_FS_directory(params), type="directory", @@ -314,15 +314,17 @@ class Master(Script): def get_zeppelin_conf_FS(self, params): return self.get_zeppelin_conf_FS_directory(params) + "/interpreter.json" - def is_path_exists_in_HDFS(self, path, as_user): + def is_directory_exists_in_HDFS(self, path, as_user): kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") -path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -e {path};echo $?"), + +#-d: if the path is a directory, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -d {path};echo $?"), user=as_user)[1] # if there is no kerberos setup then the string will contain "-bash: kinit: command not found" if "\n" in path_exists: - path_exists = path_exists.split("\n")[1] + path_exists = path_exists.split("\n").pop() # '1' means it does not exists if path_exists == '0': @@ -330,6 +332,31 @@ class Master(Script): else: return False + def is_file_exists_in_HDFS(self, path, as_user): +kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None)) +kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};") + +#-f: if the path is a file, return 0. +path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -f {path};echo $?"), + user=as_user)[1] + +# if there is no kerberos setup then the string will contain "-bash: kinit: command not found" +if "\n" in path_exists: + path_exists = path_exists.split("\n").pop() + +# '1' means it does not exists +if path_exists == '0': + #-z: if the file is zero length, return 0. + path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -z {path};echo $?"), + user=as_user)[1] + + if "\n" in path_exists: +