-
Notifications
You must be signed in to change notification settings - Fork 1.3k
server: set template type to ROUTING or USER if template type is not specified when upload a template #12768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
8111b6c
9dd0695
e376b7d
de7290b
e01730a
567f2b0
e5cd7e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2416,7 +2416,7 @@ public TemplateType validateTemplateType(BaseCmd cmd, boolean isAdmin, boolean i | |
| } else if ((cmd instanceof RegisterVnfTemplateCmd || cmd instanceof UpdateVnfTemplateCmd) && !TemplateType.VNF.equals(templateType)) { | ||
| throw new InvalidParameterValueException("The template type must be VNF for VNF templates, but the actual type is " + templateType); | ||
| } | ||
| } else if (cmd instanceof RegisterTemplateCmd) { | ||
| } else if (cmd instanceof RegisterTemplateCmd || cmd instanceof GetUploadParamsForTemplateCmd) { | ||
| boolean isRouting = Boolean.TRUE.equals(isRoutingType); | ||
| templateType = (cmd instanceof RegisterVnfTemplateCmd) ? TemplateType.VNF : (isRouting ? TemplateType.ROUTING : TemplateType.USER); | ||
| } | ||
|
Comment on lines
+2419
to
2422
|
||
|
|
@@ -2426,6 +2426,8 @@ public TemplateType validateTemplateType(BaseCmd cmd, boolean isAdmin, boolean i | |
| throw new InvalidParameterValueException(String.format("Users can not register Template with template type %s.", templateType)); | ||
| } else if (cmd instanceof UpdateTemplateCmd) { | ||
| throw new InvalidParameterValueException(String.format("Users can not update Template to template type %s.", templateType)); | ||
|
sureshanaparti marked this conversation as resolved.
|
||
| } else if (cmd instanceof GetUploadParamsForTemplateCmd) { | ||
| throw new InvalidParameterValueException(String.format("Users can not upload Template to template type %s.", templateType)); | ||
|
weizhouapache marked this conversation as resolved.
Outdated
|
||
| } | ||
| } | ||
| return templateType; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.