Hello Alex Lourie,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/18250
to review the following change.
Change subject: packaging: setup: skipping database checks if DB is empty
......................................................................
packaging: setup: skipping database checks if DB is empty
The current asynctasks and dbvalidations checks are run
during all upgrade flows.
The new implementation runs these checks on upgrade flows
only if DB is not empty.
Change-Id: Id95beac6054843b67dc2ea3311e664d9d194e9ab
Signed-off-by: Alex Lourie <[email protected]>
---
M packaging/setup/plugins/ovirt-engine-setup/upgrade/asynctasks.py
M packaging/setup/plugins/ovirt-engine-setup/upgrade/dbvalidations.py
2 files changed, 22 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/50/18250/1
diff --git a/packaging/setup/plugins/ovirt-engine-setup/upgrade/asynctasks.py
b/packaging/setup/plugins/ovirt-engine-setup/upgrade/asynctasks.py
index a6f9a2a..3ed0ef8 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/upgrade/asynctasks.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/upgrade/asynctasks.py
@@ -298,11 +298,19 @@
@plugin.event(
stage=plugin.Stages.STAGE_SETUP,
+ after=(
+ osetupcons.Stages.DB_CONNECTION_SETUP,
+ ),
)
def _setup(self):
- self._enabled = self.environment[
- osetupcons.CoreEnv.ACTION
- ] == osetupcons.Const.ACTION_UPGRADE
+ self._enabled = (
+ self.environment[
+ osetupcons.CoreEnv.ACTION
+ ] == osetupcons.Const.ACTION_UPGRADE and
+ not self.environment[
+ osetupcons.DBEnv.NEW_DATABASE
+ ]
+ )
@plugin.event(
stage=plugin.Stages.STAGE_VALIDATION,
diff --git
a/packaging/setup/plugins/ovirt-engine-setup/upgrade/dbvalidations.py
b/packaging/setup/plugins/ovirt-engine-setup/upgrade/dbvalidations.py
index 88cbbd0..cbb9908 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/upgrade/dbvalidations.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/upgrade/dbvalidations.py
@@ -102,11 +102,19 @@
@plugin.event(
stage=plugin.Stages.STAGE_SETUP,
+ after=(
+ osetupcons.Stages.DB_CONNECTION_SETUP,
+ ),
)
def _setup(self):
- self._enabled = self.environment[
- osetupcons.CoreEnv.ACTION
- ] == osetupcons.Const.ACTION_UPGRADE
+ self._enabled = (
+ self.environment[
+ osetupcons.CoreEnv.ACTION
+ ] == osetupcons.Const.ACTION_UPGRADE and
+ not self.environment[
+ osetupcons.DBEnv.NEW_DATABASE
+ ]
+ )
@plugin.event(
stage=plugin.Stages.STAGE_VALIDATION,
--
To view, visit http://gerrit.ovirt.org/18250
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id95beac6054843b67dc2ea3311e664d9d194e9ab
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches