Simone Tiraboschi has uploaded a new change for review.

Change subject: packaging: setup: let the user customize engine appliance 
memory size
......................................................................

packaging: setup: let the user customize engine appliance memory size

Let the user customize engine appliance memory size using the
ovf specified value as a default

Change-Id: If7a84a962437ee0f51e6265f8ebb73edc7526e66
Bug-Url: https://bugzilla.redhat.com/1205663
Signed-off-by: Simone Tiraboschi <stira...@redhat.com>
---
M src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py
1 file changed, 23 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup 
refs/changes/55/40355/1

diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py 
b/src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py
index d5a657e..8602206 100644
--- a/src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py
+++ b/src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py
@@ -221,6 +221,7 @@
         super(Plugin, self).__init__(context=context)
         self._source_image = None
         self._image_path = None
+        self._ovf_mem_size_mb = None
 
     def _parse_ovf(self, tar, ovf_xml):
         valid = True
@@ -302,9 +303,7 @@
                         unit=unit,
                     )
                 )
-            self.environment[
-                ohostedcons.VMEnv.MEM_SIZE_MB
-            ] = tree.find(
+            self._ovf_mem_size_mb = tree.find(
                 'Content/Section/Item/{'
                 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema'
                 '/2/CIM_ResourceAllocationSettingData'
@@ -442,6 +441,27 @@
                             ]
                         )
                     )
+
+        if self.environment[
+             ohostedcons.VMEnv.MEM_SIZE_MB
+        ] is None:
+            if interactive:
+                self.environment[
+                    ohostedcons.VMEnv.MEM_SIZE_MB
+                ] = self.dialog.queryString(
+                    name='ovehosted_vmenv_mem_ovf',
+                    note=_(
+                        'Please specify the memory size of the appliance '
+                        'in MB [Defaults to OVF value: @DEFAULT@]: '
+                    ),
+                    prompt=True,
+                    default=self._ovf_mem_size_mb,
+                )
+            else:
+                self.environment[
+                    ohostedcons.VMEnv.MEM_SIZE_MB
+                ] = self._ovf_mem_size_mb
+
         valid = False
         checker = ohosteddomains.DomainChecker()
         while not valid:


-- 
To view, visit https://gerrit.ovirt.org/40355
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If7a84a962437ee0f51e6265f8ebb73edc7526e66
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <stira...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to