Change in ovirt-engine[master]: engine: Incorrect VM TimeZone handling

ofrenkel at redhat.com ofrenkel at redhat.com
Tue Sep 17 17:19:55 UTC 2013


Omer Frenkel has submitted this change and it was merged.

Change subject: engine: Incorrect VM TimeZone handling
......................................................................


engine: Incorrect VM TimeZone handling

In case or running a VM from older engine installation it was possible
to run a VM with incorrect timezone (empty string '') which is not a
valid value (null - meaning 'use engine default' or valid time-zone key
for given OS type). This caused the regression in frontend as it tried
to select the empty string in the TimeZone lisbox editor and failed.

Added new ValidTimeZone annotation and used it to validate VmBase
on Create/Update/Import commands and also RunVmCommand so as to
prevent runnning of VMs with incorrect timezone.

Refactoring:

Required to unify TZ handling in TimeZoneType with necessary small
changes to make it portable to GWT resulting in simplified TimeZoneModel
and avoiding asynchronous patterns in VmModelBehaviorBase.

This new TimeZoneType enum contains all necessary information related
to given timezone type (currently windows or linux/java), namely:
- the list of valid time zone values
- ConfigValue and ConfigurationValue of the default timezone key
- ultimate fallback value to be used even when the default config
value is invalid (GMT+00:00)

Change-Id: Ifd36656bd4f0288e86b1cbd46d702fa68051e28b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=988259
Signed-off-by: Martin Betak <mbetak at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
D backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetTimeZonesQuery.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java
D backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetTimeZonesQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmCommandTest.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/TimeZoneType.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/ValidationUtils.java
A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/TimeZoneValidator.java
A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/annotation/ValidTimeZone.java
A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/group/StartEntity.java
A backend/manager/modules/common/src/test/java/org/ovirt/engine/core/common/TimeZoneTypeTest.java
M backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/Match.java
M backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/MatchGroups.java
M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/TemplateMapper.java
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java
M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/SysprepHandler.java
M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java
M frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Compat.gwt.xml
M frontend/webadmin/modules/gwt-extension/src/main/java/org/ovirt/engine/ui/uioverrides/org/ovirt/engine/core/compat/Match.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TimeZoneModel.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java
M frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
31 files changed, 457 insertions(+), 384 deletions(-)

Approvals:
  Omer Frenkel: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd36656bd4f0288e86b1cbd46d702fa68051e28b
Gerrit-PatchSet: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpastern at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list