Simone Tiraboschi has uploaded a new change for review.

Change subject: packaging: setup: fixing VM parameters type when read from an 
OVF file
......................................................................

packaging: setup: fixing VM parameters type when read from an OVF file

If manually entered (booting from CD), VCPUS and MEM_SIZE_MB
are stored in the enviroment as strings, if read from OVF
they should be stored in the same way cause everything else assume that
they are strings.

Change-Id: Ie9adf2248995a5e9e12d01065d4d5d4e4acdaa9d
Bug-Url: https://bugzilla.redhat.com/1198725
Signed-off-by: Simone Tiraboschi <[email protected]>
---
M src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py
1 file changed, 7 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup 
refs/changes/89/38389/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 2b229e0..2a96091 100644
--- a/src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py
+++ b/src/plugins/ovirt-hosted-engine-setup/vm/boot_disk.py
@@ -287,7 +287,7 @@
             )
             self.environment[
                 ohostedcons.VMEnv.VCPUS
-            ] = num_of_sockets * cpu_per_socket
+            ] = str(num_of_sockets * cpu_per_socket)
             self.logger.debug('Configuring memory')
             unit = tree.find(
                 'Content/Section/Item/{'
@@ -303,14 +303,12 @@
                 )
             self.environment[
                 ohostedcons.VMEnv.MEM_SIZE_MB
-            ] = int(
-                tree.find(
-                    'Content/Section/Item/{'
-                    'http://schemas.dmtf.org/wbem/wscim/1/cim-schema'
-                    '/2/CIM_ResourceAllocationSettingData'
-                    '}VirtualQuantity'
-                ).text
-            )
+            ] = tree.find(
+                'Content/Section/Item/{'
+                'http://schemas.dmtf.org/wbem/wscim/1/cim-schema'
+                '/2/CIM_ResourceAllocationSettingData'
+                '}VirtualQuantity'
+            ).text
         except Exception as e:
             self.logger.debug(
                 'Error parsing OVF file',


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9adf2248995a5e9e12d01065d4d5d4e4acdaa9d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-hosted-engine-setup
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to