networks: eliminate a variable

This commit is contained in:
Yousong Zhou
2020-05-20 11:00:36 +08:00
parent df2d98d8c2
commit 1d78510fab
+1 -5
View File
@@ -53,10 +53,6 @@ import (
"yunion.io/x/onecloud/pkg/util/stringutils2"
)
var (
ALL_NETWORK_TYPES = api.ALL_NETWORK_TYPES
)
type SNetworkManager struct {
db.SSharableVirtualResourceBaseManager
db.SExternalizedResourceBaseManager
@@ -1271,7 +1267,7 @@ func (manager *SNetworkManager) validateEnsureZoneVpc(ctx context.Context, userC
func (manager *SNetworkManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.NetworkCreateInput) (api.NetworkCreateInput, error) {
if input.ServerType == "" {
input.ServerType = api.NETWORK_TYPE_GUEST
} else if !utils.IsInStringArray(input.ServerType, ALL_NETWORK_TYPES) {
} else if !utils.IsInStringArray(input.ServerType, api.ALL_NETWORK_TYPES) {
return input, httperrors.NewInputParameterError("Invalid server_type: %s", input.ServerType)
}