Merge pull request #5730 from leseb/fix-get-user

ceph: fix GetUser
This commit is contained in:
Sébastien Han
2020-06-29 18:04:17 +02:00
committed by GitHub
+3 -3
View File
@@ -92,11 +92,11 @@ func GetUser(c *Context, id string) (*ObjectUser, int, error) {
// note: err is set for non-existent user but result output is also empty
result, err := runAdminCommand(c, "user", "info", "--uid", id)
if len(result) == 0 {
return nil, RGWErrorNotFound, errors.New("warn: user not found")
if strings.Contains(result, "no user info saved") {
return nil, RGWErrorNotFound, errors.New("warn: s3 user not found")
}
if err != nil {
return nil, RGWErrorUnknown, errors.Wrap(err, "radosgw-admin command err")
return nil, RGWErrorUnknown, errors.Wrapf(err, "radosgw-admin command err. %s", result)
}
return decodeUser(result)
}