mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
region: fix error msg for invalid wire_level_for_vmware
This commit is contained in:
@@ -17,6 +17,7 @@ package compute
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
"yunion.io/x/onecloud/pkg/util/choices"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -67,6 +68,12 @@ const (
|
||||
CLOUD_ACCOUNT_WIRE_LEVEL_CLUSTER = "cluster"
|
||||
)
|
||||
|
||||
var CLOUD_ACCOUNT_WIRE_LEVELS = choices.NewChoices(
|
||||
CLOUD_ACCOUNT_WIRE_LEVEL_VCENTER,
|
||||
CLOUD_ACCOUNT_WIRE_LEVEL_DATACENTER,
|
||||
CLOUD_ACCOUNT_WIRE_LEVEL_CLUSTER,
|
||||
)
|
||||
|
||||
const (
|
||||
CLOUD_ACCESS_ENV_AWS_GLOBAL = CLOUD_PROVIDER_AWS + "-int"
|
||||
CLOUD_ACCESS_ENV_AWS_CHINA = CLOUD_PROVIDER_AWS
|
||||
|
||||
@@ -417,7 +417,7 @@ func (scm *SCloudaccountManager) hostVMIPsPrepareNets(ctx context.Context, clien
|
||||
}
|
||||
}
|
||||
default:
|
||||
return nil, httperrors.NewInputParameterError("valid wire_level_for_vmware, accept vcenter, datacenter, cluster")
|
||||
return nil, httperrors.NewInputParameterError("invalid wire_level_for_vmware %q, accept %s", wireLevel, api.CLOUD_ACCOUNT_WIRE_LEVELS)
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user