mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix: 1. glance/keystone version handler fix 2. allow run glance as normal user
This commit is contained in:
@@ -31,6 +31,9 @@ const (
|
||||
func initHandlers(app *appsrv.Application) {
|
||||
db.InitAllManagers()
|
||||
|
||||
// add version handler with API_VERSION prefix
|
||||
app.AddDefaultHandler("GET", API_VERSION+"/version", appsrv.VersionHandler, "version")
|
||||
|
||||
db.RegistUserCredCacheUpdater()
|
||||
|
||||
db.AddProjectResourceCountHandler(API_VERSION, app)
|
||||
|
||||
@@ -35,7 +35,6 @@ import (
|
||||
_ "yunion.io/x/onecloud/pkg/image/tasks"
|
||||
"yunion.io/x/onecloud/pkg/image/torrent"
|
||||
"yunion.io/x/onecloud/pkg/util/fileutils2"
|
||||
"yunion.io/x/onecloud/pkg/util/sysutils"
|
||||
)
|
||||
|
||||
func StartService() {
|
||||
@@ -45,10 +44,11 @@ func StartService() {
|
||||
dbOpts := &opts.DBOptions
|
||||
common_options.ParseOptions(opts, os.Args, "glance-api.conf", api.SERVICE_TYPE)
|
||||
|
||||
isRoot := sysutils.IsRootPermission()
|
||||
if !isRoot {
|
||||
log.Fatalf("glance service must running with root permissions")
|
||||
}
|
||||
// no need to run glance as root any more
|
||||
// isRoot := sysutils.IsRootPermission()
|
||||
// if !isRoot {
|
||||
// log.Fatalf("glance service must running with root permissions")
|
||||
// }
|
||||
|
||||
if opts.PortV2 > 0 {
|
||||
log.Infof("Port V2 %d is specified, use v2 port", opts.PortV2)
|
||||
|
||||
@@ -31,6 +31,9 @@ const (
|
||||
func initHandlers(app *appsrv.Application) {
|
||||
db.InitAllManagers()
|
||||
|
||||
// add version handler with API_VERSION prefix
|
||||
app.AddDefaultHandler("GET", API_VERSION+"/version", appsrv.VersionHandler, "version")
|
||||
|
||||
// quotas.AddQuotaHandler(models.QuotaManager, API_VERSION, app)
|
||||
usages.AddUsageHandler(API_VERSION, app)
|
||||
taskman.AddTaskHandler(API_VERSION, app)
|
||||
|
||||
Reference in New Issue
Block a user