diff --git a/pkg/compute/models/networks.go b/pkg/compute/models/networks.go index 40b643fc4b..b5b5e0fce4 100644 --- a/pkg/compute/models/networks.go +++ b/pkg/compute/models/networks.go @@ -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) }