[VOL-1587] Fix the bug introduced when creating a UNI port on a
parent device
Change-Id: Id2f0e759cc12b8df6cc470065006215ae2a9d300
diff --git a/adapters/simulated_onu/adaptercore/device_handler.go b/adapters/simulated_onu/adaptercore/device_handler.go
index e3d20fc..217614c 100644
--- a/adapters/simulated_onu/adaptercore/device_handler.go
+++ b/adapters/simulated_onu/adaptercore/device_handler.go
@@ -126,23 +126,11 @@
if err := dh.coreProxy.PortCreated(nil, cloned.Id, dh.uniPort); err != nil {
log.Errorw("error-creating-nni-port", log.Fields{"deviceId": device.Id, "error": err})
}
- // Create UNI port in parent device
- uniPort := &voltha.Port{
- PortNo: uni_port,
- Label: fmt.Sprintf("uni-%d", uni_port),
- Type: voltha.Port_ETHERNET_UNI,
- AdminState: voltha.AdminState_ENABLED,
- OperStatus: voltha.OperStatus_ACTIVE,
+ // use Pon port number on which this ONU has been detected
+ ponPortNo := uint32(1)
+ if device.ParentPortNo != 0 {
+ ponPortNo = device.ParentPortNo
}
- if err := dh.coreProxy.PortCreated(nil, cloned.ParentId, uniPort); err != nil {
- log.Errorw("error-creating-nni-port", log.Fields{"deviceId": device.Id, "error": err})
- }
-
- // use Pon port number on which this ONU has been detected
- ponPortNo := uint32(1)
- if device.ParentPortNo != 0 {
- ponPortNo = device.ParentPortNo
- }
// Now create the PON Port
dh.ponPort = &voltha.Port{
PortNo: ponPortNo,