commit | 29ecdeee0f64b630966c3b46decf19abcff1cd1a | [log] [tgz] |
---|---|---|
author | Charles Chan <rascov@gmail.com> | Wed Feb 22 18:46:56 2017 -0800 |
committer | Charles Chan <rascov@gmail.com> | Fri Feb 24 14:00:36 2017 -0800 |
tree | 55f65da93093cf60a7b351afd0c58d619f20411c | |
parent | 9a710b2ff8de27f612471d1829214ecf18771241 [diff] [blame] |
Do not override configured hosts - When multiple host providers add the same host, the configured one will always win - A provider can only remove a host provided by itself Change-Id: I38d95cceed6f36c71b8417ce6812bbd5add10e57
diff --git a/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java b/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java index 356df9c..bfb60c7 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java +++ b/core/store/dist/src/main/java/org/onosproject/store/host/impl/DistributedHostStore.java
@@ -119,6 +119,11 @@ return true; } + // Avoid overriding configured hosts + if (existingHost.configured()) { + return false; + } + if (!Objects.equals(existingHost.providerId(), providerId) || !Objects.equals(existingHost.mac(), hostDescription.hwAddress()) || !Objects.equals(existingHost.vlan(), hostDescription.vlan()) ||