mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-07-02 04:14:24 +08:00
fix(region): add generate_name if not before validate guest creating data (#13686)
This commit is contained in:
@@ -193,6 +193,10 @@ func Brand2Hypervisor(brand string) string {
|
||||
}
|
||||
|
||||
func (gtm *SGuestTemplateManager) validateContent(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, content *jsonutils.JSONDict) (*computeapis.ServerCreateInput, error) {
|
||||
// hack
|
||||
if !content.Contains("name") && !content.Contains("generate_name") {
|
||||
content.Set("generate_name", jsonutils.NewString("fake_name"))
|
||||
}
|
||||
input, err := GuestManager.validateCreateData(ctx, userCred, ownerId, query, content)
|
||||
if err != nil {
|
||||
return nil, httperrors.NewInputParameterError("%v", err)
|
||||
|
||||
Reference in New Issue
Block a user