Fix OpenstackSwitchingHostProvider to add segment id in host annotation.
- Segment id will be used in SONA GUI
Change-Id: Ifa0e43e8d4243c711085c11e0ee861ce421823e4
diff --git a/apps/openstacknetworking/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingHostProvider.java b/apps/openstacknetworking/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingHostProvider.java
index 712409d..9dfb229 100644
--- a/apps/openstacknetworking/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingHostProvider.java
+++ b/apps/openstacknetworking/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingHostProvider.java
@@ -75,6 +75,7 @@
private static final String PORT_NAME_PREFIX_VM = "tap";
private static final String ERR_ADD_HOST = "Failed to add host: ";
+ private static final String ANNOTATION_SEGMENT_ID = "segId";
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected CoreService coreService;
@@ -169,7 +170,8 @@
DefaultAnnotations.Builder annotations = DefaultAnnotations.builder()
.set(ANNOTATION_NETWORK_ID, osPort.getNetworkId())
.set(ANNOTATION_PORT_ID, osPort.getId())
- .set(ANNOTATION_CREATE_TIME, String.valueOf(System.currentTimeMillis()));
+ .set(ANNOTATION_CREATE_TIME, String.valueOf(System.currentTimeMillis()))
+ .set(ANNOTATION_SEGMENT_ID, osNet.getProviderSegID());
HostDescription hostDesc = new DefaultHostDescription(
macAddr,