[node-patches] Change in ovirt-node[master]: installer: Fix default flags

fabiand at fedoraproject.org fabiand at fedoraproject.org
Fri Mar 1 10:09:22 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: installer: Fix default flags
......................................................................

installer: Fix default flags

Previously not all necessary flags were set for a successful
installation, even worse - the file containaing the flags
(/etc/default/ovirt) wasn't re-read after it was modified.

Now all flags are set and the file is re-read prior to starting the
installation.

Change-Id: I9673df42b08e7082b8fc0982aacf6a380b2381f9
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/config/defaults.py
M scripts/tui/src/ovirt/node/installer/progress_page.py
2 files changed, 26 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/53/12553/1

diff --git a/scripts/tui/src/ovirt/node/config/defaults.py b/scripts/tui/src/ovirt/node/config/defaults.py
index 61f947e..a1d6045 100644
--- a/scripts/tui/src/ovirt/node/config/defaults.py
+++ b/scripts/tui/src/ovirt/node/config/defaults.py
@@ -1190,7 +1190,6 @@
     >>> data = n.retrieve().items()
     """
     keys = ("OVIRT_INIT",
-            "OVIRT_ROOT_INSTALL",
             "OVIRT_OVERCOMMIT",
             "OVIRT_VOL_ROOT_SIZE",
             "OVIRT_VOL_EFI_SIZE",
@@ -1200,23 +1199,31 @@
             "OVIRT_VOL_DATA_SIZE",
             "OVIRT_INSTALL",
             "OVIRT_UPGRADE",
+            "OVIRT_INSTALL_ROOT",
+            "OVIRT_ROOT_INSTALL",
+            "OVIRT_ISCSI_INSTALL"
             )
 
     @NodeConfigFileSection.map_and_update_defaults_decorator
-    def update(self, init, root_install, overcommit, root_size, efi_size,
+    def update(self, init, overcommit, root_size, efi_size,
                swap_size, logging_size, config_size, data_size, install,
-               upgrade):
+               upgrade, install_root, root_install, iscsi_install):
         # FIXME no checking!
         return {"OVIRT_INIT": ",".join(init),
+                "OVIRT_INSTALL_ROOT": "y" if install_root else None,
                 "OVIRT_ROOT_INSTALL": "y" if root_install else None,
                 "OVIRT_INSTALL": "1" if install else None,
-                "OVIRT_UPGRADE": "1" if install else None}
+                "OVIRT_UPGRADE": "1" if upgrade else None,
+                "OVIRT_ISCSI_INSTALL": "1" if iscsi_install else None}
 
     def retrieve(self):
         cfg = dict(NodeConfigFileSection.retrieve(self))
         cfg.update({"init": cfg["init"].split(",") if cfg["init"] else [],
+                    "install_root": cfg["install_root"] == "y",
                     "root_install": cfg["root_install"] == "y",
-                    "install": cfg["install"] == "1"})
+                    "install": cfg["install"] == "1",
+                    "iscsi_install": cfg["iscsi_install"] == "1",
+                    "upgrade": cfg["upgrade"] == "1"})
         return cfg
 
     def transaction(self):
@@ -1228,8 +1235,10 @@
         are going to be picked up by the installer backend to install Node on
         the given storage with the given othere params
         """
-        self.update(init=init,
-                    install=True,
+        self.update(install=True,
+                    install_root=True,
+                    root_install=True,
+                    init=init,
                     root_size=root_size,
                     efi_size=efi_size,
                     swap_size=swap_size,
diff --git a/scripts/tui/src/ovirt/node/installer/progress_page.py b/scripts/tui/src/ovirt/node/installer/progress_page.py
index 5a49308..64635cd 100644
--- a/scripts/tui/src/ovirt/node/installer/progress_page.py
+++ b/scripts/tui/src/ovirt/node/installer/progress_page.py
@@ -183,15 +183,14 @@
             cfg = self.config
             model = defaults.Installation()
 
-            model.update(init=[cfg["boot.device"]] +
-                         cfg["installation.devices"],
-                         install="1",
-                         root_size=cfg["storage.root_size"],
-                         efi_size=cfg["storage.efi_size"],
-                         swap_size=cfg["storage.swap_size"],
-                         logging_size=cfg["storage.logging_size"],
-                         config_size=cfg["storage.config_size"],
-                         data_size=cfg["storage.data_size"])
+            model.install_on(init=[cfg["boot.device"]] +
+                             cfg["installation.devices"],
+                             root_size=cfg["storage.root_size"],
+                             efi_size=cfg["storage.efi_size"],
+                             swap_size=cfg["storage.swap_size"],
+                             logging_size=cfg["storage.logging_size"],
+                             config_size=cfg["storage.config_size"],
+                             data_size=cfg["storage.data_size"])
 
             kbd = defaults.Keyboard()
             kbd.update(self.config["keyboard.layout"])
@@ -210,6 +209,8 @@
 
         def commit(self):
             from ovirtnode import storage
+            # Reload is needed to re-read defaults file ..
+            reload(storage._functions)
             config_storage = storage.Storage()
             storage_setup = config_storage.perform_partitioning()
             if not storage_setup:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9673df42b08e7082b8fc0982aacf6a380b2381f9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list