lblistener: 改正监听update

Fixes e4ef23515f ("aws elb support")
This commit is contained in:
Yousong Zhou
2019-09-18 12:18:07 +00:00
parent d7c2ffd8c7
commit 8a51fd02fe
2 changed files with 3 additions and 1 deletions
@@ -467,7 +467,8 @@ func (lbr *SLoadbalancerListenerRule) AllowPerformStatus(ctx context.Context, us
func (lbr *SLoadbalancerListenerRule) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
backendGroupV := validators.NewModelIdOrNameValidator("backend_group", "loadbalancerbackendgroup", lbr.GetOwnerId())
if err := backendGroupV.Optional(true).Validate(data); err != nil {
backendGroupV.Optional(true)
if err := backendGroupV.Validate(data); err != nil {
return nil, err
}
@@ -319,6 +319,7 @@ func (lblis *SLoadbalancerListener) StartLoadBalancerListenerSyncstatusTask(ctx
func (lblis *SLoadbalancerListener) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error) {
ownerId := lblis.GetOwnerId()
backendGroupV := validators.NewModelIdOrNameValidator("backend_group", "loadbalancerbackendgroup", ownerId)
backendGroupV.Optional(true)
if err := backendGroupV.Validate(data); err != nil {
return nil, err
}