Remove logic to create a link when network configuration is added.
Change-Id: I9e26308c0f5ce9c5b70ccdbc37d97e4f480ff227
diff --git a/core/net/src/main/java/org/onosproject/net/link/impl/LinkManager.java b/core/net/src/main/java/org/onosproject/net/link/impl/LinkManager.java
index 326020b..ef09ee7 100644
--- a/core/net/src/main/java/org/onosproject/net/link/impl/LinkManager.java
+++ b/core/net/src/main/java/org/onosproject/net/link/impl/LinkManager.java
@@ -370,20 +370,14 @@
Link link = getLink(src, dst);
LinkDescription desc;
- if (link == null) {
- // TODO Revisit this behaviour.
- // config alone probably should not be adding a link,
- // netcfg provider should be the one.
- desc = BasicLinkOperator.descriptionOf(src, dst, cfg);
- } else {
+ if (link != null) {
desc = BasicLinkOperator.combine(cfg,
BasicLinkOperator.descriptionOf(src, dst, link));
+ ProviderId pid = Optional.ofNullable(link)
+ .map(Link::providerId)
+ .orElse(ProviderId.NONE);
+ store.createOrUpdateLink(pid, desc);
}
-
- ProviderId pid = Optional.ofNullable(link)
- .map(Link::providerId)
- .orElse(ProviderId.NONE);
- store.createOrUpdateLink(pid, desc);
}
}
}