Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: setup: database: move connect to database library
......................................................................

packaging: setup: database: move connect to database library

this will enable use of single tweaks for different driver versions.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1067058
Change-Id: I17224df000a8c4457c8fa26d6f0131ef8e3867ed
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-dwh/db/connection.py
1 file changed, 4 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-dwh refs/changes/35/25335/1

diff --git 
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-dwh/db/connection.py 
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-dwh/db/connection.py
index 0cdf755..677bab6 100644
--- 
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-dwh/db/connection.py
+++ 
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-dwh/db/connection.py
@@ -24,9 +24,6 @@
 _ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-dwh')
 
 
-import psycopg2
-
-
 from otopi import constants as otopicons
 from otopi import transaction
 from otopi import util
@@ -294,22 +291,16 @@
         ),
     )
     def _connection(self):
-        # must be here as we do not have database at validation
-        self.environment[
-            odwhcons.DBEnv.CONNECTION
-        ] = psycopg2.connect(
-            host=self.environment[odwhcons.DBEnv.HOST],
-            port=self.environment[odwhcons.DBEnv.PORT],
-            user=self.environment[odwhcons.DBEnv.USER],
-            password=self.environment[odwhcons.DBEnv.PASSWORD],
-            database=self.environment[odwhcons.DBEnv.DATABASE],
-        )
         self.environment[
             odwhcons.DBEnv.STATEMENT
         ] = database.Statement(
             environment=self.environment,
             dbenvkeys=odwhcons.Const.DWH_DB_ENV_KEYS,
         )
+        # must be here as we do not have database at validation
+        self.environment[
+            odwhcons.DBEnv.CONNECTION
+        ] = self.environment[odwhcons.DBEnv.STATEMENT].connect()
 
 
 # vim: expandtab tabstop=4 shiftwidth=4


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

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

Reply via email to