region: fix error msg for invalid wire_level_for_vmware

This commit is contained in:
Yousong Zhou
2020-12-24 11:49:41 +08:00
parent ccf89de75c
commit ce05e5290c
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -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
+1 -1
View File
@@ -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
}