Alex Lourie has uploaded a new change for review.

Change subject: packaging: Stopped using backup.sh script for DB backup
......................................................................

packaging: Stopped using backup.sh script for DB backup

This patch replaces the usage of the backup.sh script
for backing up the DB during upgrade/cleanup operations
with the direct pg_dump command with same parameters.

The reason for this is that the script itself delivered
with a different package than the setup utilities, so its
functionality is not available to the setup; this leads
the setup to fail in various flows.

Change-Id: Ic2b6f5c36e3005b5fdeeb3a5558414fe353d5e6e
Bug-Url: https://bugzilla.redhat.com/920712
Signed-off-by: Alex Lourie <[email protected]>
---
M packaging/fedora/setup/basedefs.py
M packaging/fedora/setup/common_utils.py
2 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/06/13106/1

diff --git a/packaging/fedora/setup/basedefs.py 
b/packaging/fedora/setup/basedefs.py
index 2957fb7..646715d 100644
--- a/packaging/fedora/setup/basedefs.py
+++ b/packaging/fedora/setup/basedefs.py
@@ -77,7 +77,6 @@
 FILE_JBOSSAS_CONF="/etc/%s/%s.conf" % (ENGINE_SERVICE_NAME, 
ENGINE_SERVICE_NAME)
 FILE_DB_INSTALL_SCRIPT="engine-db-install.sh"
 FILE_DB_UPGRADE_SCRIPT="upgrade.sh"
-FILE_DB_BACKUP_SCRIPT="backup.sh"
 FILE_DB_ASYNC_TASKS="%s/scripts/add_fn_db_get_async_tasks_function.sql" % 
DIR_ENGINE
 FILE_ENGINE_CONFIG_BIN="/usr/bin/engine-config"
 FILE_ENGINE_CONFIG_PROPS="engine-config-install.properties"
diff --git a/packaging/fedora/setup/common_utils.py 
b/packaging/fedora/setup/common_utils.py
index 8c1aa94..c6d8749 100755
--- a/packaging/fedora/setup/common_utils.py
+++ b/packaging/fedora/setup/common_utils.py
@@ -851,12 +851,18 @@
 
     # Run backup
     cmd = [
-        os.path.join(".", basedefs.FILE_DB_BACKUP_SCRIPT),
-        "-u", user,
-        "-s", host,
-        "-p", port,
-        "-d", db,
-        "-f", backup_file,
+        basedefs.EXEC_PGDUMP,
+        '-C',
+        '-E',
+        'UTF8',
+        '--disable-dollar-quoting',
+        '--disable-triggers',
+        '--format=p',
+        '-u', user,
+        '-s', host,
+        '-p', port,
+        '-d', db,
+        '-f', backup_file,
     ]
     execCmd(cmdList=cmd, cwd=basedefs.DIR_DB_SCRIPTS, failOnError=True, 
msg=output_messages.ERR_DB_BACKUP, envDict=env)
     logging.debug("%s DB Backup completed successfully", db)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2b6f5c36e3005b5fdeeb3a5558414fe353d5e6e
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