[VOL-1890] Flow decomposition fails after a core switch over
Cherry Pick into the master branch from voltha-2.1
Change-Id: I84c3a83b5b9115d6ec334af29634486ba7148634
diff --git a/rw_core/core/device_agent.go b/rw_core/core/device_agent.go
index a61ca25..89b1fe9 100755
--- a/rw_core/core/device_agent.go
+++ b/rw_core/core/device_agent.go
@@ -95,18 +95,19 @@
log.Errorw("failed-to-load-device", log.Fields{"deviceId": agent.deviceId})
return status.Errorf(codes.NotFound, "device-%s", agent.deviceId)
}
- log.Debugw("device-loaded-from-dB", log.Fields{"device": agent.lastData})
+ log.Debugw("device-loaded-from-dB", log.Fields{"deviceId": agent.deviceId})
} else {
// Add the initial device to the local model
if added := agent.clusterDataProxy.AddWithID(ctx, "/devices", agent.deviceId, agent.lastData, ""); added == nil {
log.Errorw("failed-to-add-device", log.Fields{"deviceId": agent.deviceId})
+ return status.Errorf(codes.Aborted, "failed-adding-device-%s", agent.deviceId)
}
}
agent.deviceProxy = agent.clusterDataProxy.CreateProxy(ctx, "/devices/"+agent.deviceId, false)
agent.deviceProxy.RegisterCallback(model.POST_UPDATE, agent.processUpdate)
- log.Debug("device-agent-started")
+ log.Debugw("device-agent-started", log.Fields{"deviceId": agent.deviceId})
return nil
}