[VOL-1949] fix individual port state change
Change-Id: I66b94e83b6513b657af15c395a907b200735c764
diff --git a/rw_core/core/device_manager.go b/rw_core/core/device_manager.go
index beff7ae..0ae1491 100755
--- a/rw_core/core/device_manager.go
+++ b/rw_core/core/device_manager.go
@@ -830,7 +830,12 @@
func (dMgr *DeviceManager) updatePortState(deviceId string, portType voltha.Port_PortType, portNo uint32, operStatus voltha.OperStatus_OperStatus) error {
log.Debugw("updatePortState", log.Fields{"deviceid": deviceId, "portType": portType, "portNo": portNo, "operStatus": operStatus})
if agent := dMgr.getDeviceAgent(deviceId); agent != nil {
- return agent.updatePortState(portType, portNo, operStatus)
+ if err := agent.updatePortState(portType, portNo, operStatus); err != nil {
+ log.Errorw("updating-port-state-failed", log.Fields{"deviceid": deviceId, "portNo": portNo, "error": err})
+ return err
+ }
+ // Notify the logical device manager to change the port state
+ go dMgr.logicalDeviceMgr.updatePortState(deviceId, portNo, operStatus)
}
return status.Errorf(codes.NotFound, "%s", deviceId)
}