Roy Golan has uploaded a new change for review.

Change subject: core: TimeZoneValidator allow null or empty value
......................................................................

core: TimeZoneValidator allow null or empty value

importing 3.2 VMs can result time_zone value to be empty string,
which is equivilant to null in this case.

the validator is modify to support null or empty values as valid ones.

Change-Id: I0f5ca114b8dd41aaba5de0e882aa6d42c3d99c5f
Signed-off-by: Roy Golan <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/TimeZoneValidator.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/89/22989/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/TimeZoneValidator.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/TimeZoneValidator.java
index 29cd69d..1f338dd 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/TimeZoneValidator.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/TimeZoneValidator.java
@@ -19,7 +19,7 @@
 
     @Override
     public boolean isValid(VmBase value, ConstraintValidatorContext context) {
-        if (value.getTimeZone() == null) {
+        if (value.getTimeZone() == null || value.getTimeZone().isEmpty()) {
             return true;
         }
         TimeZoneType timeZoneType = osRepository.isWindows(value.getOsId()) ? 
TimeZoneType.WINDOWS_TIMEZONE : TimeZoneType.GENERAL_TIMEZONE;


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

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

Reply via email to