Merge branch 'master' into bugfix/tb-api-get-spec-dispatcher-fix

This commit is contained in:
tb365
2019-08-13 15:02:16 +08:00
committed by GitHub
4 changed files with 23 additions and 7 deletions
+12 -2
View File
@@ -151,8 +151,18 @@ func init() {
return doComputeEventList(s, &nargs)
})
R(&TypeEventListOptions{}, "vcenter-event", "Show operation event logs of vcenter", func(s *mcclient.ClientSession, args *TypeEventListOptions) error {
nargs := EventListOptions{BaseEventListOptions: args.BaseEventListOptions, Id: args.ID, Type: []string{"vcenter"}}
R(&TypeEventListOptions{}, "cloud-provider-event", "Show operation event logs of cloudprovider", func(s *mcclient.ClientSession, args *TypeEventListOptions) error {
nargs := EventListOptions{BaseEventListOptions: args.BaseEventListOptions, Id: args.ID, Type: []string{"cloudprovider"}}
return doComputeEventList(s, &nargs)
})
R(&TypeEventListOptions{}, "cloud-account-event", "Show operation event logs of cloudaccount", func(s *mcclient.ClientSession, args *TypeEventListOptions) error {
nargs := EventListOptions{BaseEventListOptions: args.BaseEventListOptions, Id: args.ID, Type: []string{"cloudaccount"}}
return doComputeEventList(s, &nargs)
})
R(&TypeEventListOptions{}, "bucket-event", "Show operation event logs of bucket", func(s *mcclient.ClientSession, args *TypeEventListOptions) error {
nargs := EventListOptions{BaseEventListOptions: args.BaseEventListOptions, Id: args.ID, Type: []string{"bucket"}}
return doComputeEventList(s, &nargs)
})
-4
View File
@@ -217,10 +217,6 @@ func (self *SQcloudGuestDriver) GetGuestInitialStateAfterRebuild() string {
return api.VM_RUNNING
}
func (self *SQcloudGuestDriver) IsNeedInjectPasswordByCloudInit(desc *cloudprovider.SManagedVMCreateConfig) bool {
return true
}
func (self *SQcloudGuestDriver) GetUserDataType() string {
return cloudprovider.CLOUD_SHELL
}
+5
View File
@@ -214,10 +214,15 @@ func (bucket *SBucket) getStats() cloudprovider.SBucketStats {
func (bucket *SBucket) GetShortDesc(ctx context.Context) *jsonutils.JSONDict {
desc := bucket.SVirtualResourceBase.GetShortDesc(ctx)
desc.Add(jsonutils.NewInt(bucket.SizeBytes), "size_bytes")
desc.Add(jsonutils.NewInt(int64(bucket.ObjectCnt)), "object_cnt")
desc.Add(jsonutils.NewString(bucket.Acl), "acl")
desc.Add(jsonutils.NewString(bucket.StorageClass), "storage_class")
info := bucket.getCloudProviderInfo()
desc.Update(jsonutils.Marshal(&info))
return desc
}
+6 -1
View File
@@ -34,6 +34,7 @@ import (
"yunion.io/x/sqlchemy"
api "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/cloudcommon/consts"
"yunion.io/x/onecloud/pkg/cloudcommon/db"
"yunion.io/x/onecloud/pkg/cloudcommon/db/lockman"
"yunion.io/x/onecloud/pkg/cloudcommon/db/taskman"
@@ -678,7 +679,11 @@ func (manager *SNetworkManager) newFromCloudNetwork(ctx context.Context, userCre
net.GuestGateway = extNet.GetGateway()
net.ServerType = extNet.GetServerType()
net.IsPublic = extNet.GetIsPublic()
net.PublicScope = string(extNet.GetPublicScope())
extScope := extNet.GetPublicScope()
if extScope == rbacutils.ScopeDomain && !consts.GetNonDefaultDomainProjects() {
extScope = rbacutils.ScopeSystem
}
net.PublicScope = string(extScope)
net.AllocTimoutSeconds = extNet.GetAllocTimeoutSeconds()