Martin Betak has uploaded a new change for review.

Change subject: frontend: Fix display of custom properties on edit VM
......................................................................

frontend: Fix display of custom properties on edit VM

In ExistingVmModelBehavior the custom properties sheet was not
deserialized from entity to corresponding widget.

Also on backend when we were dealing with VM that has next runtime
configuration the OvfImport did copy the userDefined and predefined
properties but not the aggregate customProperties.

Change-Id: I523c61595911138b07ee74563239dd80ccb8cc99
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1128433
Signed-off-by: Martin Betak <[email protected]>
---
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmReader.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java
2 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/90/31990/1

diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmReader.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmReader.java
index adc8db0..664c00f 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmReader.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfVmReader.java
@@ -19,6 +19,7 @@
 import org.ovirt.engine.core.common.businessentities.VmStatic;
 import 
org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface;
 import org.ovirt.engine.core.common.utils.VmDeviceCommonUtils;
+import org.ovirt.engine.core.common.utils.customprop.VmPropertiesUtils;
 import org.ovirt.engine.core.compat.Guid;
 import org.ovirt.engine.core.compat.Version;
 import org.ovirt.engine.core.compat.backendcompat.XmlDocument;
@@ -259,6 +260,11 @@
             }
         }
 
+        // {@link VM#predefinedProperties} and {@link VM#userDefinedProperties}
+        // are being set in the above alias handling, we need to update custom 
properties
+        // to keep them consistent
+        
_vm.setCustomProperties(VmPropertiesUtils.getInstance().customProperties(_vm.getPredefinedProperties(),
 _vm.getUserDefinedProperties()));
+
         node = content.SelectSingleNode(OvfProperties.APPLICATIONS_LIST);
         if (node != null) {
             if (StringUtils.isNotEmpty(node.innerText)) {
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java
index a7a6970..a3617c7 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java
@@ -168,6 +168,8 @@
 
         getModel().getCpuPinning().setEntity(vm.getCpuPinning());
 
+        
getModel().getCustomPropertySheet().deserialize(vm.getCustomProperties());
+
         if (isHotSetCpuSupported()) {
             // cancel related events while fetching data
             
getModel().getTotalCPUCores().getEntityChangedEvent().removeListener(getModel());


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I523c61595911138b07ee74563239dd80ccb8cc99
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Martin Betak <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to