Roy Golan has posted comments on this change.
Change subject: engine: Incorrect VM TimeZone handling
......................................................................
Patch Set 3:
(2 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
Line 639: }
Line 640:
Line 641: // set the timezone to use the engine default if trying to run VM
with incorrect TZ set
Line 642: private void handleTimeZone() {
Line 643: TimeZoneType timeZoneType =
OsRepositoryImpl.INSTANCE.isWindows(getVm().getOs()) ?
TimeZoneType.WINDOWS_TIMEZONE : TimeZoneType.GENERAL_TIMEZONE;
can you pls move OsRepositoryImpl to a field (my fault I didn't do that before)
OsRepositoy osRepository =
SimpleDependecyInjector.getInstance().get(OsRepository.class)
Line 644: if (getVm().getTimeZone() != null &&
!timeZoneType.getTimeZoneList().containsKey(getVm().getTimeZone())) {
Line 645: log.warnFormat("ResourceManager::{0}::Attempting to run
VM {1} with incorrect timezone '{2}'. Resetting timezone to engine default.",
Line 646: getClass().getName(),
Line 647: getVmId().toString(),
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/TimeZoneType.java
Line 12: import java.util.LinkedHashMap;
Line 13: import java.util.LinkedList;
Line 14: import java.util.List;
Line 15: import java.util.Map;
Line 16:
its nice to have this as an enum and delete the Query class . nice idea
nevertheless I think this data shouldn't reside in the code at all and really
should be a resource file. this means it also could be shared between backend
an UI with no query
so under usr/share/ovirt-engine/timzones we can keep this resource (Properties
file basically) and load it
general-timzones.properties
Etc/GMT=(GMT+00:00) GMT Standard Time
Asia/Kabul=(GMT+04:30) Afghanistan Standard Time
....
windows-timezones.properties
Arabian Standard Time=(GMT+04:00) Arabian Standard Time
W. Australia Standard Time=(GMT+08:00) W. Australia Standard Time
...
maybe in one file
timezones.properties
timezones.general.Etc/GMT=(GMT+00:00) GMT Standard Time
...
timezones.windows.Arabian Standard Time=(GMT+04:00) Arabian Standard Time
...
Line 17: public enum TimeZoneType {
Line 18: GENERAL_TIMEZONE(ConfigValues.DefaultGeneralTimeZone,
ConfigurationValues.DefaultGeneralTimeZone) {
Line 19: @Override
Line 20: protected Map<String, String> initializeTimeZoneList() {
--
To view, visit http://gerrit.ovirt.org/17524
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifd36656bd4f0288e86b1cbd46d702fa68051e28b
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Martin Betak <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Tomas Jelinek <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches