Updated Branches: refs/heads/trunk a50d9904e -> 62cd37677
AMBARI-3198. ambari-server reset is broken on centos5.8 (Dmytro Sen via dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/62cd3767 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/62cd3767 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/62cd3767 Branch: refs/heads/trunk Commit: 62cd376777c67d548c52faca07153c353b471284 Parents: a50d990 Author: Lisnichenko Dmitro <[email protected]> Authored: Thu Sep 12 16:55:02 2013 +0300 Committer: Lisnichenko Dmitro <[email protected]> Committed: Thu Sep 12 16:55:02 2013 +0300 ---------------------------------------------------------------------- ambari-server/src/main/python/ambari-server.py | 13 +++++++++---- .../src/main/resources/Ambari-DDL-Postgres-DROP.sql | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/62cd3767/ambari-server/src/main/python/ambari-server.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari-server.py b/ambari-server/src/main/python/ambari-server.py index 6bd4d36..4ee3817 100755 --- a/ambari-server/src/main/python/ambari-server.py +++ b/ambari-server/src/main/python/ambari-server.py @@ -2082,7 +2082,7 @@ def reset(args): retcode, out, err = execute_remote_script(args, DATABASE_DROP_SCRIPTS[DATABASE_INDEX]) if not retcode == 0: if retcode == -1: - print_warning_msg('Cannot find ' + client_desc + + print_warning_msg('Cannot find ' + client_desc + ' client in the path to reset the Ambari Server ' + 'schema. To reset Ambari Server schema ' + 'you must run the following DDL against the database ' + @@ -2091,7 +2091,8 @@ def reset(args): + 'against the database to create the schema: ' + os.linesep + client_usage_cmd_init + os.linesep ) raise NonFatalException(err) - + if err: + print_warning_msg(err) retcode, out, err = execute_remote_script(args, DATABASE_INIT_SCRIPTS[DATABASE_INDEX]) if not retcode == 0: if retcode == -1: @@ -2103,7 +2104,8 @@ def reset(args): 'against the database to create the schema: ' + os.linesep + client_usage_cmd_init + os.linesep ) raise NonFatalException(err) - + if err: + print_warning_msg(err) else: err = 'Cannot find ' + client_desc + ' client in the path to reset the Ambari ' +\ 'Server schema. To reset Ambari Server schema ' + \ @@ -2123,7 +2125,8 @@ def reset(args): retcode, outdata, errdata = run_os_command(command) if not retcode == 0: raise FatalException(1, errdata) - + if errdata: + print_warning_msg(errdata) print_info_msg ("About to run database setup") setup_db(args) @@ -2292,6 +2295,8 @@ def upgrade_stack(args, stack_id): retcode, outdata, errdata = run_os_command(command) if not retcode == 0: raise FatalException(retcode, errdata) + if errdata: + print_warning_msg(errdata) return retcode http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/62cd3767/ambari-server/src/main/resources/Ambari-DDL-Postgres-DROP.sql ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-DROP.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-DROP.sql index ffd942a..a538043 100644 --- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-DROP.sql +++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-DROP.sql @@ -15,5 +15,5 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- -DROP DATABASE IF EXISTS :dbname; -DROP DATABASE IF EXISTS ambarirca; +DROP DATABASE :dbname; +DROP DATABASE ambarirca;
