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/c679234d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c679234d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c679234d

Branch: refs/heads/branch-2.1
Commit: c679234d38f420d92fb4243de9e338691cd6e036
Parents: d81c31e
Author: Andrew Onishuk <aonis...@hortonworks.com>
Authored: Wed Jul 8 12:18:36 2015 +0300
Committer: Andrew Onishuk <aonis...@hortonworks.com>
Committed: Wed Jul 8 12:18:36 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/c679234d/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/c679234d/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")

Reply via email to