Merge pull request #2665 from swordqiu/hotfix/qj-identity-image-version-show

fix: 1. glance/keystone version handler fix 2. allow run glance as normal user
This commit is contained in:
yunion-ci-robot
2019-09-02 13:47:15 +08:00
committed by GitHub
3 changed files with 11 additions and 5 deletions
+3
View File
@@ -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)
+5 -5
View File
@@ -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)
+3
View File
@@ -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)