Alex Lourie has uploaded a new change for review. Change subject: packaging: setup: update db cleanup instructions ......................................................................
packaging: setup: update db cleanup instructions Change-Id: I36b6ba3ebe1f54e4d2ad1e63bc3eb5b385d59a24 Bug-Url: https://bugzilla.redhat.com/1027378 Signed-off-by: Alex Lourie <alou...@redhat.com> --- M packaging/ovirt-engine-reports-setup.py 1 file changed, 17 insertions(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/76/21576/1 diff --git a/packaging/ovirt-engine-reports-setup.py b/packaging/ovirt-engine-reports-setup.py index ba4cd51..e6bbb3b 100755 --- a/packaging/ovirt-engine-reports-setup.py +++ b/packaging/ovirt-engine-reports-setup.py @@ -83,9 +83,12 @@ #Error Messages MSG_ERROR_BACKUP_DB = "Error: Database backup failed" MSG_ERROR_RESTORE_DB = "Error: Database restore failed" -MSG_ERROR_DB_EXISTS = "ERROR: Found the database for ovirt-engine-reports, but could not find the WAR directory!\n\ -In order to remedy this situation, please drop the ovirt-engine-reports database by executing:\n\ -/usr/bin/dropdb -U %s -h %s -p %s %s" +MSG_ERROR_DB_EXISTS = "ERROR: Found the database for ovirt-engine-reports, \ +but could not find the WAR directory!\nIn order to remedy this situation, \ +please drop the %s database. For example, for local \ +controlled and provisioned setup, one could use the following command: \n\ + su postgres -c 'dropdb %s'\n\ +For other cases, please ask your DBA to remove the aforementioned DB." DIR_TEMP_SCHEDULE=tempfile.mkdtemp() @@ -1048,11 +1051,17 @@ raise RuntimeError('Could not connect to the remote DB') if not isWarInstalled() and DB_EXIST and dblocal: - logging.error("WAR Directory does not exist but the DB is up and running.") - raise Exception(MSG_ERROR_DB_EXISTS % (db_dict["username"], - db_dict["host"], - db_dict["port"], - db_dict['dbname'])) + @utils.transactionDisplay('Checking system state') + def _exitBadState(): + logging.error("WAR Directory does not exist but the DB is up and running.") + raise Exception( + MSG_ERROR_DB_EXISTS % ( + db_dict['dbname'], + db_dict['dbname'], + ) + ) + + _exitBadState() # Edit setup.xml & app-server.xml to remove profile name if not warUpdated or not isWarInstalled(): -- To view, visit http://gerrit.ovirt.org/21576 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I36b6ba3ebe1f54e4d2ad1e63bc3eb5b385d59a24 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-reports Gerrit-Branch: ovirt-3.3.1 Gerrit-Owner: Alex Lourie <alou...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches