Martin Betak has uploaded a new change for review. Change subject: backend: Fix timezone on import of Windows VMs ......................................................................
backend: Fix timezone on import of Windows VMs Incorrect default timezeone was being set based on uninitialized osId. Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1123809 Change-Id: I61197951a3ea7e0aeb1a10a7f11e7cbefd9d99fe Signed-off-by: Martin Betak <mbe...@redhat.com> --- M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java 1 file changed, 12 insertions(+), 13 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/72/31972/1 diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java index d3f53f3..8f3f556 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java @@ -357,19 +357,6 @@ } } - node = content.SelectSingleNode(OvfProperties.TIMEZONE); - if (node != null && StringUtils.isNotEmpty(node.innerText)) { - vmBase.setTimeZone(node.innerText); - } else { - if (osRepository.isWindows(vmBase.getOsId())) { - vmBase.setTimeZone(Config.<String> getValue(ConfigValues.DefaultWindowsTimeZone)); - } else { - vmBase.setTimeZone(Config.<String> getValue(ConfigValues.DefaultGeneralTimeZone)); - } - } - - - node = content.SelectSingleNode(OvfProperties.DEFAULT_BOOT_SEQUENCE); if (node != null) { if (!StringUtils.isEmpty(node.innerText)) { @@ -440,6 +427,18 @@ } } + // due to depndency on vmBase.getOsId() must be read AFTER readOsSection + node = content.SelectSingleNode(OvfProperties.TIMEZONE); + if (node != null && StringUtils.isNotEmpty(node.innerText)) { + vmBase.setTimeZone(node.innerText); + } else { + if (osRepository.isWindows(vmBase.getOsId())) { + vmBase.setTimeZone(Config.<String> getValue(ConfigValues.DefaultWindowsTimeZone)); + } else { + vmBase.setTimeZone(Config.<String> getValue(ConfigValues.DefaultGeneralTimeZone)); + } + } + node = content.SelectSingleNode(OvfProperties.ORIGIN); if (node != null) { if (!StringUtils.isEmpty(node.innerText)) { -- To view, visit http://gerrit.ovirt.org/31972 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61197951a3ea7e0aeb1a10a7f11e7cbefd9d99fe Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Martin Betak <mbe...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches