mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-16 18:02:05 +02:00
CORD-280 Fix the way to add and remove a node to consistent store
Change-Id: Iff55398d0a78acf3cdce8a5b43146f95b562d5a5
This commit is contained in:
parent
a72d44dc9d
commit
c10f7773e7
@ -146,9 +146,7 @@ public class CordVtn implements CordVtnService {
|
||||
public void addNode(OvsdbNode ovsdb) {
|
||||
checkNotNull(ovsdb);
|
||||
|
||||
if (!nodeStore.containsKey(ovsdb.deviceId())) {
|
||||
nodeStore.put(ovsdb.deviceId(), ovsdb);
|
||||
}
|
||||
nodeStore.putIfAbsent(ovsdb.deviceId(), ovsdb);
|
||||
|
||||
if (isNodeConnected(ovsdb)) {
|
||||
init(ovsdb);
|
||||
@ -161,10 +159,6 @@ public class CordVtn implements CordVtnService {
|
||||
public void deleteNode(OvsdbNode ovsdb) {
|
||||
checkNotNull(ovsdb);
|
||||
|
||||
if (!nodeStore.containsKey(ovsdb.deviceId())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (deviceService.getDevice(ovsdb.deviceId()) != null) {
|
||||
if (deviceService.isAvailable(ovsdb.deviceId())) {
|
||||
log.warn("Cannot delete connected node {}", ovsdb.host());
|
||||
|
Loading…
x
Reference in New Issue
Block a user