Simone Tiraboschi has uploaded a new change for review.

Change subject: packaging: setup: handling previously generated answerfile with 
wrong types
......................................................................

packaging: setup: handling previously generated answerfile with wrong types

Till 3.5 we were threating some VM parameters as integer
is read from the OVF file and as string if manually entered.
It was not really an issue cause we were than generating
a temporary configuration fail for vdsClient usage with an
implicit string conversion.
Now we are using vdsclient and so we have to use the correct
type and so we need also to handle answerfile generated from
previously release where the type could be not correct.

Change-Id: I07c296c4ef92430f03a5b23a2a996db9c643a9c5
Bug-Url: https://bugzilla.redhat.com/1198725
Signed-off-by: Simone Tiraboschi <[email protected]>
---
M src/plugins/ovirt-hosted-engine-setup/vm/cpu.py
M src/plugins/ovirt-hosted-engine-setup/vm/memory.py
2 files changed, 10 insertions(+), 0 deletions(-)


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

diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py 
b/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py
index c654bc4..83c77f7 100644
--- a/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py
+++ b/src/plugins/ovirt-hosted-engine-setup/vm/cpu.py
@@ -53,6 +53,11 @@
             ohostedcons.VMEnv.VCPUS,
             None
         )
+        # fixing values from answerfiles badly generated prior than 3.6
+        if type(self.environment[ohostedcons.VMEnv.VCPUS]) == int:
+            self.environment[
+                ohostedcons.VMEnv.VCPUS
+            ] = str(self.environment[ohostedcons.VMEnv.VCPUS])
 
     @plugin.event(
         stage=plugin.Stages.STAGE_CUSTOMIZATION,
diff --git a/src/plugins/ovirt-hosted-engine-setup/vm/memory.py 
b/src/plugins/ovirt-hosted-engine-setup/vm/memory.py
index ae1897e..0941da6 100644
--- a/src/plugins/ovirt-hosted-engine-setup/vm/memory.py
+++ b/src/plugins/ovirt-hosted-engine-setup/vm/memory.py
@@ -53,6 +53,11 @@
             ohostedcons.VMEnv.MEM_SIZE_MB,
             None
         )
+        # fixing values from answerfiles badly generated prior than 3.6
+        if type(self.environment[ohostedcons.VMEnv.MEM_SIZE_MB]) == int:
+            self.environment[
+                ohostedcons.VMEnv.MEM_SIZE_MB
+            ] = str(self.environment[ohostedcons.VMEnv.MEM_SIZE_MB])
 
     @plugin.event(
         stage=plugin.Stages.STAGE_CUSTOMIZATION,


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07c296c4ef92430f03a5b23a2a996db9c643a9c5
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