From e7c33a2bb4aff15a298dca776c5390189aa390a0 Mon Sep 17 00:00:00 2001 From: Mengyi Zhou Date: Tue, 11 Oct 2016 12:07:01 +0800 Subject: [PATCH] set slb-id first before vs validation --- .../zeus/service/model/impl/VirtualServerRepositoryImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ctrip/zeus/service/model/impl/VirtualServerRepositoryImpl.java b/src/main/java/com/ctrip/zeus/service/model/impl/VirtualServerRepositoryImpl.java index 9b7fca7a..11892835 100644 --- a/src/main/java/com/ctrip/zeus/service/model/impl/VirtualServerRepositoryImpl.java +++ b/src/main/java/com/ctrip/zeus/service/model/impl/VirtualServerRepositoryImpl.java @@ -78,7 +78,6 @@ public class VirtualServerRepositoryImpl implements VirtualServerRepository { @Override public VirtualServer add(VirtualServer virtualServer) throws Exception { - virtualServerModelValidator.validate(virtualServer); //TODO render for deprecated field if (virtualServer.getSlbId() != null) { if (!virtualServer.getSlbIds().contains(virtualServer.getSlbId())) { @@ -87,6 +86,8 @@ public class VirtualServerRepositoryImpl implements VirtualServerRepository { virtualServer.setSlbId(null); } + virtualServerModelValidator.validate(virtualServer); + Iterator iter = virtualServer.getSlbIds().iterator(); Set uniq = new HashSet<>(); while (iter.hasNext()) {