Modify the Capsule creation opts field.

Modify the Capsule creation opts field from "spec"
to "template". Since now there is already a field
called "spec" in the "spec", which may induce some
misunderstanding for the user.

Also delete capsule_template_version check, since
it is not a useful field.

Part of blueprint introduce-compose

Change-Id: Iea4acd24a540b86f59a28ef09be223923cf27175
Signed-off-by: Kevin Zhao <kevin.zhao@arm.com>
This commit is contained in:
Kevin Zhao 2018-01-05 17:37:18 +08:00
parent 01436550aa
commit 1bc8042149
3 changed files with 4 additions and 7 deletions

View File

@ -15,7 +15,6 @@
import json
import yaml
from zunclient.i18n import _
yaml_loader = yaml.SafeLoader
@ -56,8 +55,5 @@ def parse(tmpl_str):
else:
if tpl is None:
tpl = {}
# Looking for supported version keys in the loaded template
if not ('CapsuleTemplateFormatVersion' in tpl
or 'capsule_template_version' in tpl):
raise ValueError(_("Template format version not found."))
return tpl

View File

@ -17,7 +17,7 @@ from zunclient.common import utils
from zunclient import exceptions
CREATION_ATTRIBUTES = ['spec']
CREATION_ATTRIBUTES = ['template']
class Capsule(base.Resource):

View File

@ -36,8 +36,9 @@ def do_capsule_create(cs, args):
if args.template_file:
template = template_utils.get_template_contents(
args.template_file)
opts['spec'] = template
opts['template'] = template
cs.capsules.create(**opts)
print("Request to create capsule has been accepted.")
@utils.arg('--all-tenants',