Fix scheduled operation api validate

"operation_type" and "operation_definition" also need to verify.

Change-Id: Ic02d11efe40fbaa708b155c8296214bf2dae5a6e
This commit is contained in:
zhangshuai 2017-02-22 03:43:27 +08:00
parent 9922b17660
commit 2c85e4a0e8
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ class ScheduledOperationController(wsgi.Controller):
operation_type = operation_info.get("operation_type", None)
operation_definition = operation_info.get(
"operation_definition", None)
if name is None:
if not all([name, operation_type, operation_definition]):
msg = _("Operation name or type or definition is not provided.")
raise exc.HTTPBadRequest(explanation=msg)