[node-patches] Change in ovirt-node[master]: migration: Set version during installation

fabiand at redhat.com fabiand at redhat.com
Fri Jul 18 15:48:51 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: migration: Set version during installation
......................................................................

migration: Set version during installation

… to prevent migration rnus when it's a fresh installation.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1051728
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1054036
Change-Id: Iac2371ade2a928e218f7d7aaacd3dbc6731c12b4
Signed-off-by: Fabian Deutsch <fabiand at redhat.com>
(cherry picked from commit 893b5465808c09084eb7831393cfe15f7f345e69)
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/ovirt-auto-install.py
M src/ovirt/node/config/defaults.py
M src/ovirt/node/config/migrate.py
M src/ovirt/node/installer/core/progress_page.py
4 files changed, 17 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/43/30443/1

diff --git a/scripts/ovirt-auto-install.py b/scripts/ovirt-auto-install.py
index 287b7da..8d9b5c5 100755
--- a/scripts/ovirt-auto-install.py
+++ b/scripts/ovirt-auto-install.py
@@ -35,6 +35,13 @@
 import time
 
 
+class PrepareInstallation(Transaction.Element):
+    title = "Prepare installation"
+
+    def commit(self):
+        defaults.ConfigVersion().set_to_current()
+
+
 class ConfigureNetworking(Transaction.Element):
     title = "Configuring network"
 
@@ -214,6 +221,8 @@
 
     tx = Transaction("Automatic Installation")
 
+    tx.append(PrepareInstallation())
+
     # setup network before storage for iscsi installs
     if is_iscsi_install():
         tx.append(ConfigureNetworking())
diff --git a/src/ovirt/node/config/defaults.py b/src/ovirt/node/config/defaults.py
index 4ed9f9a..04a1a6f 100644
--- a/src/ovirt/node/config/defaults.py
+++ b/src/ovirt/node/config/defaults.py
@@ -211,6 +211,11 @@
     def update(self, ver):
         pass
 
+    def set_to_current(self):
+        curver = system.node_version()
+        self.logger.debug("Setting config version to: %s" % curver)
+        self.update(curver)
+
 
 class Network(NodeConfigFileSection):
     """Sets network stuff
diff --git a/src/ovirt/node/config/migrate.py b/src/ovirt/node/config/migrate.py
index 1289c45..29dd139 100644
--- a/src/ovirt/node/config/migrate.py
+++ b/src/ovirt/node/config/migrate.py
@@ -39,7 +39,6 @@
         """Determins if a migration and which migration is necessary
         """
         from ovirt.node.config import defaults
-
         migration_func = None
 
         cfgver = defaults.ConfigVersion().retrieve()["ver"]
@@ -62,7 +61,6 @@
 
     def _run(self, migration_func):
         from ovirt.node.config import defaults
-
         try:
             self.logger.info("Starting config migration")
 
diff --git a/src/ovirt/node/installer/core/progress_page.py b/src/ovirt/node/installer/core/progress_page.py
index 4eeda6f..347e22e 100644
--- a/src/ovirt/node/installer/core/progress_page.py
+++ b/src/ovirt/node/installer/core/progress_page.py
@@ -228,6 +228,9 @@
             kbd = defaults.Keyboard()
             kbd.update(self.config["keyboard.layout"])
 
+            vercfg = defaults.ConfigVersion()
+            vercfg.set_to_current()
+
         def commit(self):
             pass
             # Everything done during prepare


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac2371ade2a928e218f7d7aaacd3dbc6731c12b4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>



More information about the node-patches mailing list