[VOL-5541] proxy omci request only when device is reachable
Change-Id: I7cc0858e7045126421966a9acced6a3cbaa3974c
Signed-off-by: Akash Reddy Kankanala <akash.kankanala@radisys.com>
diff --git a/VERSION b/VERSION
index ec3f25f..5c6b98f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.6.6
+4.6.7
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 429178b..fbaf659 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -1709,8 +1709,8 @@
func (dh *DeviceHandler) ProxyOmciMessage(ctx context.Context, omciMsg *ia.OmciMessage) error {
logger.Debugw(ctx, "proxy-omci-message", log.Fields{"parent-device-id": omciMsg.ParentDeviceId, "child-device-id": omciMsg.ChildDeviceId, "proxy-address": omciMsg.ProxyAddress, "connect-status": omciMsg.ConnectStatus})
- if DeviceState(dh.device.ConnectStatus) != DeviceState(voltha.ConnectStatus_REACHABLE) {
- return status.Error(codes.Unavailable, "OLT unreachable")
+ if DeviceState(dh.device.ConnectStatus) != DeviceState(voltha.ConnectStatus_REACHABLE) || DeviceState(dh.device.OperStatus) != DeviceState(voltha.OperStatus_ACTIVE) {
+ return status.Error(codes.Unavailable, "OLT-is-unreachable-or-not-active")
}
if omciMsg.GetProxyAddress() == nil {
onuDevice, err := dh.getDeviceFromCore(ctx, omciMsg.ChildDeviceId)