mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
Merge pull request #1960 from yousong/bugfix/yousong-yunionconf
yunionconf: 改正启动失败问题
This commit is contained in:
@@ -17,13 +17,13 @@ package db
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
"log"
|
||||
"time"
|
||||
"yunion.io/x/onecloud/pkg/appsrv"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/object"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
@@ -57,9 +57,13 @@ func NewModelBaseManager(model interface{}, tableName string, keyword string, ke
|
||||
func (manager *SModelBaseManager) GetIModelManager() IModelManager {
|
||||
virt := manager.GetVirtualObject()
|
||||
if virt == nil {
|
||||
log.Fatalf("%s.GetIModelManager got nil!", manager.keywordPlural)
|
||||
panic(fmt.Sprintf("Forgot to call SetVirtualObject?"))
|
||||
}
|
||||
return virt.(IModelManager)
|
||||
r, ok := virt.(IModelManager)
|
||||
if !ok {
|
||||
panic(fmt.Sprintf("Cannot convert virtual object to IModelManager: %#v", virt))
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func (manager *SModelBaseManager) SetAlias(alias string, aliasPlural string) {
|
||||
|
||||
@@ -52,6 +52,7 @@ func init() {
|
||||
"service-registries",
|
||||
),
|
||||
}
|
||||
ServiceRegistryManager.SetVirtualObject(ServiceRegistryManager)
|
||||
}
|
||||
|
||||
func (manager *SServiceRegistryManager) Register(ctx context.Context, addr string, port int,
|
||||
|
||||
@@ -59,7 +59,15 @@ type SParameter struct {
|
||||
var ParameterManager *SParameterManager
|
||||
|
||||
func init() {
|
||||
ParameterManager = &SParameterManager{SResourceBaseManager: db.NewResourceBaseManager(SParameter{}, "paramters_tbl", "parameter", "parameters")}
|
||||
ParameterManager = &SParameterManager{
|
||||
SResourceBaseManager: db.NewResourceBaseManager(
|
||||
SParameter{},
|
||||
"paramters_tbl",
|
||||
"parameter",
|
||||
"parameters",
|
||||
),
|
||||
}
|
||||
ParameterManager.SetVirtualObject(ParameterManager)
|
||||
}
|
||||
|
||||
func isAdminQuery(query jsonutils.JSONObject) bool {
|
||||
|
||||
Reference in New Issue
Block a user