Revert "[VOL-1385] : code changes to support ONU delete"
This reverts commit e935b33392e67708b83292c27480ae5258c37724.
Change-Id: Ibd10b43d8d6264a7b0b12386eb9833b5a4864ffd
diff --git a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/core_proxy.go b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/core_proxy.go
index 7cb933d..c5e1c14 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/core_proxy.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v3/pkg/adapters/common/core_proxy.go
@@ -284,7 +284,7 @@
volthaDevice := &voltha.Device{}
if err := ptypes.UnmarshalAny(result, volthaDevice); err != nil {
logger.Warnw("cannot-unmarshal-response", log.Fields{"error": err})
- return nil, status.Error(codes.InvalidArgument, err.Error())
+ return nil, status.Errorf(codes.InvalidArgument, "%s", err.Error())
}
return volthaDevice, nil
} else {
@@ -294,8 +294,8 @@
logger.Warnw("cannot-unmarshal-response", log.Fields{"error": err})
}
logger.Debugw("ChildDeviceDetected-return", log.Fields{"deviceid": parentDeviceId, "success": success, "error": err})
-
- return nil, status.Error(ICProxyErrorCodeToGrpcErrorCode(unpackResult.Code), unpackResult.Reason)
+ // TODO: Need to get the real error code
+ return nil, status.Errorf(codes.Internal, "%s", unpackResult.Reason)
}
}
@@ -361,7 +361,7 @@
volthaDevice := &voltha.Device{}
if err := ptypes.UnmarshalAny(result, volthaDevice); err != nil {
logger.Warnw("cannot-unmarshal-response", log.Fields{"error": err})
- return nil, status.Error(codes.InvalidArgument, err.Error())
+ return nil, status.Errorf(codes.InvalidArgument, "%s", err.Error())
}
return volthaDevice, nil
} else {
@@ -372,7 +372,7 @@
}
logger.Debugw("GetDevice-return", log.Fields{"deviceid": parentDeviceId, "success": success, "error": err})
// TODO: Need to get the real error code
- return nil, status.Error(ICProxyErrorCodeToGrpcErrorCode(unpackResult.Code), unpackResult.Reason)
+ return nil, status.Errorf(codes.Internal, "%s", unpackResult.Reason)
}
}
@@ -421,7 +421,7 @@
volthaDevice := &voltha.Device{}
if err := ptypes.UnmarshalAny(result, volthaDevice); err != nil {
logger.Warnw("cannot-unmarshal-response", log.Fields{"error": err})
- return nil, status.Error(codes.InvalidArgument, err.Error())
+ return nil, status.Errorf(codes.InvalidArgument, "%s", err.Error())
}
return volthaDevice, nil
} else {
@@ -432,7 +432,13 @@
}
logger.Debugw("GetChildDevice-return", log.Fields{"deviceid": parentDeviceId, "success": success, "error": err})
- return nil, status.Error(ICProxyErrorCodeToGrpcErrorCode(unpackResult.Code), unpackResult.Reason)
+ code := codes.Internal
+
+ if unpackResult.Code == ic.ErrorCode_DEADLINE_EXCEEDED {
+ code = codes.DeadlineExceeded
+ }
+
+ return nil, status.Errorf(code, "%s", unpackResult.Reason)
}
}
@@ -457,7 +463,7 @@
volthaDevices := &voltha.Devices{}
if err := ptypes.UnmarshalAny(result, volthaDevices); err != nil {
logger.Warnw("cannot-unmarshal-response", log.Fields{"error": err})
- return nil, status.Error(codes.InvalidArgument, err.Error())
+ return nil, status.Errorf(codes.InvalidArgument, "%s", err.Error())
}
return volthaDevices, nil
} else {
@@ -468,7 +474,13 @@
}
logger.Debugw("GetChildDevices-return", log.Fields{"deviceid": parentDeviceId, "success": success, "error": err})
- return nil, status.Error(ICProxyErrorCodeToGrpcErrorCode(unpackResult.Code), unpackResult.Reason)
+ code := codes.Internal
+
+ if unpackResult.Code == ic.ErrorCode_DEADLINE_EXCEEDED {
+ code = codes.DeadlineExceeded
+ }
+
+ return nil, status.Errorf(code, "%s", unpackResult.Reason)
}
}