Alex Lourie has uploaded a new change for review.

Change subject: packaging: updated permission of fkvalidator function
......................................................................

packaging: updated permission of fkvalidator function

This patch is an amendment to gerrit.ovirt.org:/12512
and it updates the permissions of the fkvalidator
stored procedure function to engine.
Signed-off-by: Alex Lourie <[email protected]>

Bug-Url: https://bugzilla.redhat.com/893459
Change-Id: Ie8f64a8369633562e4b919cb64c80793c194bff9
Signed-off-by: Alex Lourie <[email protected]>
---
M backend/manager/tools/dbutils/fkvalidator.sh
M packaging/fedora/setup/engine-upgrade.py
2 files changed, 11 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/94/14594/1

diff --git a/backend/manager/tools/dbutils/fkvalidator.sh 
b/backend/manager/tools/dbutils/fkvalidator.sh
index 106807d..54e2e97 100755
--- a/backend/manager/tools/dbutils/fkvalidator.sh
+++ b/backend/manager/tools/dbutils/fkvalidator.sh
@@ -90,6 +90,7 @@
 
 # Install fkvalidator procedures
 psql -w -U ${USERNAME} -h ${SERVERNAME} -p ${PORT} -f ./fkvalidator_sp.sql 
${DATABASE} > /dev/null
+psql -w -U ${USERNAME} -h ${SERVERNAME} -p ${PORT} -c "ALTER FUNCTION 
fn_db_validate_fks(boolean) OWNER TO engine;" ${DATABASE} > /dev/null
 
 if [[ "${FIXIT}" = "true" && ! "${QUIET}" = "true" ]]; then
     echo "Caution, this operation should be used with care. Please contact 
support prior to running this command"
diff --git a/packaging/fedora/setup/engine-upgrade.py 
b/packaging/fedora/setup/engine-upgrade.py
index cf3c924..e2d9391 100755
--- a/packaging/fedora/setup/engine-upgrade.py
+++ b/packaging/fedora/setup/engine-upgrade.py
@@ -186,6 +186,10 @@
                       action="store_true", dest="ignore_tasks", default=False,
                       help=SUPPRESS_HELP)
 
+    parser.add_option("-d", "--force-db-fix",
+                      action="store_true", dest="force_db_fix", default=False,
+                      help=SUPPRESS_HELP)
+
     parser.add_option("-n", "--no-space-check", help="Disable space check", 
action="store_true", default=False)
 
 
@@ -1310,9 +1314,12 @@
                             # If violations found, show them
                             # and ask for cleanup
                             if issues_found:
-                                if utils.askYesNo(
-                                    MSG_CLEAR_DB_INCONSISTENCIES % violations
-                                ) is True:
+                                if (
+                                    options.force_db_fix is True
+                                    or utils.askYesNo(
+                                        MSG_CLEAR_DB_INCONSISTENCIES % 
violations
+                                    ) is True
+                                ):
                                     fixDb()
                                 else:
                                     raise Exception(


--
To view, visit http://gerrit.ovirt.org/14594
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8f64a8369633562e4b919cb64c80793c194bff9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alex Lourie <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to