Yedidyah Bar David has uploaded a new change for review.

Change subject: packaging: setup: Report errors during db restore
......................................................................

packaging: setup: Report errors during db restore

Change-Id: I8e1a3e281cee907d652db1193a7e36130de20260
ug-Url: https://bugzilla.redhat.com/1078871
Signed-off-by: Yedidyah Bar David <[email protected]>
---
M packaging/setup/ovirt_engine_setup/engine_common/database.py
1 file changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/52/37252/1

diff --git a/packaging/setup/ovirt_engine_setup/engine_common/database.py 
b/packaging/setup/ovirt_engine_setup/engine_common/database.py
index 11d15a9..f638b32 100644
--- a/packaging/setup/ovirt_engine_setup/engine_common/database.py
+++ b/packaging/setup/ovirt_engine_setup/engine_common/database.py
@@ -570,7 +570,7 @@
         self,
         backupFile,
     ):
-        self._plugin.execute(
+        rc, stdout, stderr = self._plugin.execute(
             (
                 self.command.get('pg_restore'),
                 '-w',
@@ -586,10 +586,20 @@
                 'PGPASSFILE': self.environment[self._dbenvkeys['pgpassfile']],
             },
             raiseOnError=False,
+        )
+        if (rc != 0) or stderr:
             # TODO: check stderr of this and raise an error if there are real
             # errors. We currently always have one about plpgsql already
             # existing. When doing that, verify with both pg 8 and 9.
-        )
+            # Some of the filtering done in engine-backup, which uses psql,
+            # does not apply here because pg_restore behaves differently.
+            self.logger.error(
+                _('Errors while restoring {name} 
database:\n{stderr}\n').format(
+                    name=self.environment[self._dbenvkeys['database'],
+                    stderr='\n'.join(stderr),
+                )
+            )
+
 
     def _checkDbEncoding(self, environment, name):
 


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

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

Reply via email to