ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fba...@apache.org
Subject ambari git commit: AMBARI-10902 Bootstrap on Windows: Retrying commands adds garbage data to stdout
Date Wed, 06 May 2015 16:55:59 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 8ce46ac26 -> 0041836a2


AMBARI-10902 Bootstrap on Windows: Retrying commands adds garbage data to stdout

Fixed retry message placement


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0041836a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0041836a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0041836a

Branch: refs/heads/trunk
Commit: 0041836a232ca25f71271757460548fe777baa0e
Parents: 8ce46ac
Author: Florian Barca <fbarca@hortonworks.com>
Authored: Wed May 6 09:55:52 2015 -0700
Committer: Florian Barca <fbarca@hortonworks.com>
Committed: Wed May 6 09:55:52 2015 -0700

----------------------------------------------------------------------
 ambari-server/src/main/python/setupAgent.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0041836a/ambari-server/src/main/python/setupAgent.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/setupAgent.py b/ambari-server/src/main/python/setupAgent.py
index a762d54..7a8d545 100755
--- a/ambari-server/src/main/python/setupAgent.py
+++ b/ambari-server/src/main/python/setupAgent.py
@@ -50,7 +50,7 @@ def _ret_append_stdout(ret, stdout):
   temp_stderr = ret['log'][1]
   if stdout:
     if temp_stdout:
-      temp_stdout += "\n"
+      temp_stdout += os.linesep
     temp_stdout += stdout
   ret['log'] = (temp_stdout, temp_stderr)
 
@@ -59,7 +59,7 @@ def _ret_append_stderr(ret, stderr):
   temp_stderr = ret['log'][1]
   if stderr:
     if temp_stderr:
-      temp_stderr += "\n"
+      temp_stderr += os.linesep
     temp_stderr += stderr
   ret['log'] = (temp_stdout, temp_stderr)
 
@@ -69,11 +69,11 @@ def _ret_merge(ret, retcode, stdout, stderr):
   temp_stderr = ret['log'][1]
   if stdout:
     if temp_stdout:
-      temp_stdout += "\n"
+      temp_stdout += os.linesep
     temp_stdout += stdout
   if stderr:
     if temp_stderr:
-      temp_stderr += "\n"
+      temp_stderr += os.linesep
     temp_stderr += stderr
   ret['log'] = (temp_stdout, temp_stderr)
   return ret
@@ -89,14 +89,13 @@ def execOsCommand(osCommand, tries=1, try_sleep=0, ret=None, cwd=None):
   for i in range(0, tries):
     if i > 0:
       time.sleep(try_sleep)
+      _ret_append_stderr(ret, "Retrying " + str(osCommand))
 
     retcode, stdout, stderr = run_os_command(osCommand, cwd=cwd)
     _ret_merge(ret, retcode, stdout, stderr)
     if retcode == 0:
       break
 
-    _ret_append_stdout(ret, "\nRetrying " + str(osCommand))
-
   return ret
 
 @OsFamilyFuncImpl(OsFamilyImpl.DEFAULT)


Mime
View raw message