Repository: ambari Updated Branches: refs/heads/trunk b028fc86a -> 4910de95e
AMBARI-19202. Devdeploy: Database check failed.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4910de95 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4910de95 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4910de95 Branch: refs/heads/trunk Commit: 4910de95e36e3d15144b8e61f98499d117c6692d Parents: b028fc8 Author: Vitaly Brodetskyi <[email protected]> Authored: Wed Dec 14 18:17:18 2016 +0200 Committer: Vitaly Brodetskyi <[email protected]> Committed: Wed Dec 14 18:17:18 2016 +0200 ---------------------------------------------------------------------- ambari-common/src/main/python/ambari_commons/os_linux.py | 7 ++++++- ambari-server/src/main/python/ambari_server/checkDatabase.py | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4910de95/ambari-common/src/main/python/ambari_commons/os_linux.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/ambari_commons/os_linux.py b/ambari-common/src/main/python/ambari_commons/os_linux.py index 497b1a5..25368c6 100644 --- a/ambari-common/src/main/python/ambari_commons/os_linux.py +++ b/ambari-common/src/main/python/ambari_commons/os_linux.py @@ -45,8 +45,13 @@ def os_run_os_command(cmd, env=None, shell=False, cwd=None): env=env, cwd=cwd, shell=shell - ) + ) + process_pid = process.pid (stdoutdata, stderrdata) = process.communicate() + if stdoutdata: + stdoutdata = stdoutdata + "\nprocess_pid=" + str(process_pid) + "\n" + else: + stdoutdata = "\nprocess_pid=" + str(process_pid) + "\n" return process.returncode, stdoutdata, stderrdata def os_change_owner(filePath, user, recursive): http://git-wip-us.apache.org/repos/asf/ambari/blob/4910de95/ambari-server/src/main/python/ambari_server/checkDatabase.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server/checkDatabase.py b/ambari-server/src/main/python/ambari_server/checkDatabase.py index a6c58e0..2a3e0ba 100644 --- a/ambari-server/src/main/python/ambari_server/checkDatabase.py +++ b/ambari-server/src/main/python/ambari_server/checkDatabase.py @@ -80,9 +80,8 @@ def check_database(options): if retcode > 0: - print str(stdout) - raise FatalException(1, 'Database check failed to complete. Please check ' + configDefaults.SERVER_LOG_FILE + - ' and ' + configDefaults.DB_CHECK_LOG + ' for more information.') + raise FatalException(int(retcode), "Database check failed to complete: {0}. \nPlease check {1} and {2} for more " + "information.".format(stdout+stderr, configDefaults.SERVER_LOG_FILE, configDefaults.DB_CHECK_LOG)) else: print str(stdout) if not stdout.startswith("No errors"):
