Add a verification about the provider_id of plan

Change-Id: Ideb96b4d96fec673ffc0815d1f9840911c8afe70
Closes-Bug: #1686765
This commit is contained in:
chenying 2017-04-28 00:56:02 +08:00
parent df7c98a7ae
commit 74f828c876
1 changed files with 3 additions and 0 deletions

View File

@ -142,6 +142,9 @@ def do_plan_list(cs, args):
help='The description of a plan.')
def do_plan_create(cs, args):
"""Creates a plan."""
if not uuidutils.is_uuid_like(args.provider_id):
raise exceptions.CommandError(
"Invalid provider id provided.")
plan_resources = _extract_resources(args)
_check_resources(cs, plan_resources)
plan_parameters = _extract_parameters(args)