mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Automatic merge from release/2.3.0 -> release/2.4.0
* commit '0aafe01ee8d8934f54b75b1c2366c5dd72857101': 避免project未找到直接返回err
This commit is contained in:
@@ -10,6 +10,8 @@ import (
|
||||
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db/lockman"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/util/httputils"
|
||||
)
|
||||
|
||||
type STenantCacheManager struct {
|
||||
@@ -81,6 +83,9 @@ func (manager *STenantCacheManager) fetchTenantFromKeystone(ctx context.Context,
|
||||
s := auth.GetAdminSession(ctx, consts.GetRegion(), "v1")
|
||||
tenant, err := modules.Projects.Get(s, idStr, nil)
|
||||
if err != nil {
|
||||
if je, ok := err.(*httputils.JSONClientError); ok && je.Code == 404 {
|
||||
return nil, sql.ErrNoRows
|
||||
}
|
||||
log.Errorf("fetch project fail %s", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user