Yedidyah Bar David has posted comments on this change.

Change subject: packaging: setup: partial cleanup - db only
......................................................................


Patch Set 2:

(5 comments)

....................................................
File packaging/setup/plugins/ovirt-engine-setup/core/misc.py
Line 82:         if (
Line 83:             self.environment[osetupcons.DBEnv.NEW_DATABASE] and
Line 84:             self.environment[
Line 85:                 osetupcons.CoreEnv.ACTION
Line 86:             ] == osetupcons.Const.ACTION_UPGRADE
Yes, but then the message to the log will be misleading if we arrive here with 
action already = setup.
Line 87:         ):
Line 88:             self.logger.debug(
Line 89:                 'Changing ACTION from UPGRADE to SETUP because we are '
Line 90:                 'creating a new database'


Line 85:                 osetupcons.CoreEnv.ACTION
Line 86:             ] == osetupcons.Const.ACTION_UPGRADE
Line 87:         ):
Line 88:             self.logger.debug(
Line 89:                 'Changing ACTION from UPGRADE to SETUP because we are '
Done
Line 90:                 'creating a new database'
Line 91:             )
Line 92:             self.environment[
Line 93:                 osetupcons.CoreEnv.ACTION


....................................................
File packaging/setup/plugins/ovirt-engine-setup/legacy/database.py
Line 73
Line 74
Line 75
Line 76
Line 77
You probably meant:
 self.environment[osetupcons.DBEnv.NEW_DATABASE] = False
or I did not understand.


Line 87:             if dbovirtutils.isNewDatabase():
Line 88:                 raise RuntimeError(
Line 89:                     _('Unexpected empty database during upgrade')
Line 90:                 )
Line 91:         except (psycopg2.InterfaceError, RuntimeError) as e:
Done.

Still, some of our code does:
 try:
     tryDatabaseConnect()
 except RuntimeError:
So we might want to change tryDatabaseConnect to check also InterfaceError 
anyway. Not sure.
Line 92:             self.logger.debug(
Line 93:                 'Database connection failed while trying to upgrade 
from '
Line 94:                 'legacy, creating a new database',
Line 95:                 exc_info=True,


Line 88:                 raise RuntimeError(
Line 89:                     _('Unexpected empty database during upgrade')
Line 90:                 )
Line 91:         except (psycopg2.InterfaceError, RuntimeError) as e:
Line 92:             self.logger.debug(
Done
Line 93:                 'Database connection failed while trying to upgrade 
from '
Line 94:                 'legacy, creating a new database',
Line 95:                 exc_info=True,
Line 96:             )


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id9aa1791eb7ccdbc8c679e72ed6eaa4f72ac29c6
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <d...@redhat.com>
Gerrit-Reviewer: Alex Lourie <alou...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Ofer Schreiber <oschr...@redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com>
Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to