Repository: ambari Updated Branches: refs/heads/branch-2.1 d81c31ed0 -> c679234d3 refs/heads/trunk 02dfbab58 -> 877141d78
AMBARI-12326. on non-root agent RU ZK restart fails (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/877141d7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/877141d7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/877141d7 Branch: refs/heads/trunk Commit: 877141d784b6dba018ca0926abe4297ca4eae2cc Parents: 02dfbab Author: Andrew Onishuk <aonis...@hortonworks.com> Authored: Wed Jul 8 12:18:34 2015 +0300 Committer: Andrew Onishuk <aonis...@hortonworks.com> Committed: Wed Jul 8 12:18:34 2015 +0300 ---------------------------------------------------------------------- .../python/resource_management/libraries/functions/validate.py | 4 ++-- .../ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/877141d7/ambari-common/src/main/python/resource_management/libraries/functions/validate.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/validate.py b/ambari-common/src/main/python/resource_management/libraries/functions/validate.py index 63196f7..c3c9ae7 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/validate.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/validate.py @@ -25,12 +25,12 @@ from resource_management.core.exceptions import Fail @retry(times=10, sleep_time=2) -def call_and_match_output(command, regex_expression, err_message): +def call_and_match_output(command, regex_expression, err_message, **call_kwargs): """ Call the command and performs a regex match on the output for the specified expression. :param command: Command to call :param regex_expression: Regex expression to search in the output """ - code, out = shell.call(command, logoutput=True) + code, out = shell.call(command, logoutput=True, quiet=False, **call_kwargs) if not (out and re.search(regex_expression, out, re.IGNORECASE)): raise Fail(err_message) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/877141d7/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py index 240882f..b7fb578 100644 --- a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py +++ b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper_server.py @@ -91,9 +91,9 @@ class ZookeeperServerLinux(ZookeeperServer): delete_command = format("echo 'delete /{unique} ' | {cli_shell}") quorum_err_message = "Failed to establish zookeeper quorum" - call_and_match_output(create_command, 'Created', quorum_err_message) - call_and_match_output(list_command, r"\[.*?" + unique + ".*?\]", quorum_err_message) - shell.call(delete_command) + call_and_match_output(create_command, 'Created', quorum_err_message, user=params.zk_user) + call_and_match_output(list_command, r"\[.*?" + unique + ".*?\]", quorum_err_message, user=params.zk_user) + shell.call(delete_command, user=params.zk_user) if params.client_port: check_leader_command = format("echo stat | nc localhost {client_port} | grep Mode")